Message processing method, apparatus, product, device and medium
By decomposing the client key into multiple shards and distributing processing and storage in multiple shard processing devices, and using the relay cluster to provide decentralized services, the problem of easy leakage of the client key is solved and achieved. Greater security and reliability.
Patent Information
- Application Number
- PCT/CN2023/129880
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-17
- Filing Date
- 2023-11-06
- Publication Date
- 2024-10-24
AI Technical Summary
Client keys are easily obtained maliciously in existing applications, causing the security of client business resources to not be guaranteed.
By decomposing the client key into multiple shard information, and performing distributed processing and storage in multiple shard processing devices, the relay cluster is used to perform decentralized relay services to ensure the safe distribution of shard information. and processing.
It improves the security and reliability of client keys, prevents key leaks, and enhances the protection of business resources.
Smart Images

Figure CN2023129880_24102024_PF_FP_ABST
Abstract
Description
Message processing method, device, product, equipment and medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 17, 2023, with application number 202310452579.4 and application name “Message Processing Method, Device, Product, Equipment and Medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a message processing method, a message processing apparatus, a computer program product, a computer device, and a computer-readable storage medium. Background Art
[0003] The client key is crucial data on the client. Leakage of the client key can put the client's business resources at significant risk. In existing applications, the client's client key is typically stored and kept by the client itself. Once the client is attacked, the client key is highly likely to be maliciously obtained, compromising the security of the client key and, consequently, the security of the client's business resources.
[0004] Summary of the Invention
[0005] The present application provides a message processing method, apparatus, product, device, and medium that can improve the reliability and security of client keys.
[0006] On one hand, the present application provides a message processing method, which is applied to a first client and includes:
[0007] Obtaining N pieces of shard information of a client key of a second client; N is a positive integer, and the N pieces of shard information are used to generate the client key; each piece of shard information is processed by a corresponding shard processing device; the second client is located in any one of the shard processing devices;
[0008] Obtaining a message topic configured at the relay cluster for each of the shard processing devices; a relay connection relationship exists between the first client and each of the shard processing devices, and the relay cluster is used to perform an open source relay service operation between the first client and any of the shard processing devices that have a relay connection relationship with the first client;
[0009] Generate a configuration message for each shard processing device according to the shard information corresponding to each shard processing device and the message topic configured for each shard processing device;
[0010] The generated N configuration messages are sent to the relay cluster, so that each of the shard processing devices respectively obtains its own configuration message from the relay cluster and processes corresponding shard information based on its own configuration message.
[0011] On one hand, the present application provides a message processing device, which is applied to a first client and includes:
[0012] A first acquisition module is configured to acquire N pieces of shard information of a client key of a second client; N is a positive integer, and the N pieces of shard information are used to generate the client key; each piece of shard information is processed by a corresponding shard processing device; and the second client is disposed in any one of the shard processing devices;
[0013] A second acquisition module is configured to obtain a message topic configured at the relay cluster for each of the shard processing devices; a relay connection relationship exists between the first client and each of the shard processing devices, and the relay cluster is configured to perform an open source relay service operation between the first client and any of the shard processing devices that have a relay connection relationship with the first client;
[0014] A generation module, configured to generate a configuration message for each shard processing device according to the shard information corresponding to each shard processing device and the message topic configured for each shard processing device;
[0015] The sending module is used to send the generated N configuration messages to the relay cluster, so that each of the shard processing devices respectively obtains its own configuration message from the relay cluster and processes the corresponding shard information based on its own configuration message.
[0016] On one hand, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method provided by the present application.
[0017] On one hand, the present application provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded by a processor and executing the above method.
[0018] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads and executes the computer program from the computer-readable storage medium, causing the computer device to perform the above method.
[0019] In the present application, the first client can obtain N shard information of the client key of the second client; the N shard information is used to generate the client key of the second client; each shard information is processed by a corresponding shard processing device; the second client is set in any shard processing device; it can be seen that since each shard information is processed by a corresponding shard processing device, the client key of the second client can be distributedly processed at multiple shard processing devices, which can improve the security of the client key. In addition, the first client can also obtain the message topic configured by each shard processing device at the relay cluster; there is a relay connection relationship between the first client and each shard processing device. In this way, the first client can communicate and interact with each shard processing device through the relay connection relationship between the first client and each shard processing device. In addition, the relay cluster is used to perform open source relay service operations between the first client and any shard processing device that has a relay connection relationship with the first client. Then, the first client can securely distribute each shard information to each shard processing device based on the open source relay service operations performed by the relay cluster, thereby ensuring the security of distributing the shard information; in addition, the first client can generate a configuration message for each shard processing device based on the shard information corresponding to each shard processing device and the message topic configured for each shard processing device; and send the generated N configuration messages to the relay cluster, so that each shard processing device can obtain its own configuration message from the relay cluster and process the corresponding shard information based on its own configuration message. It can be seen that the first client generates a configuration message for each shard processing device based on the message topic configured by each shard processing device at the relay cluster, and distributes the configuration message of each shard processing device to each shard processing device through the relay function of the relay cluster. This realizes the communication interaction between the first client and each shard processing device, and realizes the convenient distribution of N shard information, so that the client key of the second client can be distributedly processed in N shard processing devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] FIG1 is a schematic diagram of a network architecture provided by the present application;
[0021] FIG2 is a schematic diagram of a message processing scenario provided by the present application;
[0022] FIG3 is a flow chart of a message processing method provided by the present application;
[0023] FIG4 is a schematic diagram of a scenario for obtaining shard information provided by the present application;
[0024] FIG5 is a schematic diagram of a scenario for generating a configuration message provided by the present application;
[0025] FIG6 is a schematic diagram of another message processing scenario provided by the present application;
[0026] FIG7 is a flow chart of a multi-terminal connection method provided by the present application;
[0027] FIG8 is a flow chart of a business data processing method provided by the present application;
[0028] FIG9 is a schematic diagram of a business data processing scenario provided by the present application;
[0029] FIG10 is a schematic structural diagram of a message processing device provided by the present application;
[0030] FIG11 is a schematic structural diagram of a computer device provided in this application. DETAILED DESCRIPTION
[0031] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in this application. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0032] This application relates to blockchain technology. Blockchain is a novel application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of network business data (such as online transactions) and is used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.
[0033] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation management. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the correspondence between the user's real identity and the blockchain address (authority management), etc., and under authorization, it supervises and audits the business conditions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first performs interface adaptation analysis and authentication processing (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration, issuance, triggering and execution of contracts. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the contract logic is triggered by calling keys or other events to trigger execution. The contract logic is completed, and the contract upgrade and cancellation functions are also provided. The operation management module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarms, network management, and node device health status.
[0034] The platform's product service layer provides the basic capabilities and implementation framework for typical applications. Developers can build on these basic capabilities, overlay business features, and complete the blockchain implementation of business logic. The application service layer provides application services based on blockchain solutions for business participants to use.
[0035] The blockchain technology involved in this application is embodied in that the first client and / or the second client can be connected to the blockchain network to submit business data in the blockchain network for consensus processing and chain upload. The specific process can be found in the description of the embodiment corresponding to Figure 3 below.
[0036] This application also involves cloud technology. Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or a local area network to realize the calculation, storage, processing and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0037] The cloud technology involved in this application is reflected in that data exchange between multiple relay devices in a relay cluster can be carried out through the "cloud".
[0038] It should be noted that when the embodiments of this application are applied to specific products or technologies, the relevant data involved in this application (such as client keys, communication keys, and message topics configured on each end, etc.) should be collected, used, and processed in accordance with national laws and regulations. Before collecting data, the data processing rules should be informed and the separate consent and authorization of the object to which the data belongs (such as users, enterprises, or institutions) should be obtained. The data should be processed in strict accordance with the requirements of laws and regulations and the data processing rules, and technical measures should be taken to ensure the security of the relevant data.
[0039] Please refer to Figure 1, which is a structural diagram of a network architecture provided by the present application. As shown in Figure 1, the network architecture in the present application may include a first client, a relay cluster and N shard processing devices, where N is a positive integer. One or more relay devices may be configured in the relay cluster. As shown schematically in Figure 1, the relay cluster may include relay device 1b to relay device Zb, a total of Z relay devices, where Z is a positive integer). The relay device is used to perform decentralized service operations to provide decentralized relay services; the so-called decentralized relay service refers to the use of distributed relay devices to provide relay functions in network communications, rather than relying on a single centralized service device. In this way, by decentralizing the relay function, the reliability and security of the system can be improved. The N shard processing devices may include shard processing devices 1c to shard processing devices Nc, and the N shard processing devices can be used to process N shard information of the client key of the second client. In other words, the client key of the second client contains N shard information, and the N shard information corresponds one-to-one with the N shard processing devices. The so-called one-to-one correspondence means that each shard information is processed by a corresponding shard processing device, and different shard information is processed by corresponding different shard processing devices. The N shard information can be used to generate the client key of the second client. The second client can be located in any of the N shard processing devices. The first client and the second client can be any two clients.
[0040] The relay device can be a server, which can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The device where the client is located can be a terminal device. For example, the device where the first client is located can be a terminal device; for example, the shard processing device where the second client is located (belongs to) can be a terminal device. The terminal device can be a smart terminal such as a smartphone, tablet computer, laptop computer, desktop computer, smart TV, etc.
[0041] Furthermore, the first client can obtain N shard information of the client key of the second client, and there is a relay connection relationship between the first client and each shard processing device. In this way, the first client can distribute the N shard information to the N shard processing devices through the relay cluster based on the relay connection relationship, so that each shard processing device can obtain and process its corresponding shard information; for example: shard information n1 among the N shard information is processed by the corresponding shard processing device 1c, then the first client can distribute the shard information n1 to the shard processing device 1c, so that the shard processing device 1c can process the corresponding shard information n1. The principle of the first client distributing each shard information to each shard processing device through the relay cluster can be seen in the description of the embodiment corresponding to Figure 2 below.
[0042] Please refer to Figure 2, which is a schematic diagram of a message processing scenario provided by this application. As shown in Figure 2, the first client and each shard processing device (including the above-mentioned N shard processing devices) can respectively configure their own message topics at the relay cluster, and any two ends (such as the first client and any shard processing device) can interact with each other through the message topics configured by the two ends at the relay cluster. Among them, configuring a message topic (i.e. configuring a Topic) refers to a message delivery mode, which allows an object (such as a first client or a shard processing device) to configure a topic or topic to receive messages related to the configured topic or topic; this message delivery mode can improve the flexibility, scalability and reliability of message transmission.
[0043] The following is an explanation of the principle of the first client distributing the corresponding shard information to each shard processing device through the relay cluster. Schematically, the first client and the shard processing device 1c can exchange messages through the message topic configured by the first client and the message topic configured by the shard processing device 1c. For example, assuming that the shard information n1 among the N shard information is processed by the shard processing device 1c, the first client can send the shard information n1 corresponding to the shard processing device 1c to the relay cluster through the message topic configured by the shard processing device 1c. The shard processing device 1c can obtain the configuration message related to the message topic configured by itself at the relay cluster. The configuration message can include the corresponding shard information n1. In this way, the shard processing device 1c can obtain the corresponding shard information n1 through the configuration message obtained from the relay cluster and process the shard information n1 (including storage and recording).
[0044] Similarly, the first client and the shard processing device 2c can exchange messages through the message topic configured by the first client and the message topic configured by the shard processing device 2c. For example, if the shard information n2 among the N shard information is processed by the shard processing device 2c, the first client can send the shard information n2 corresponding to the shard processing device 2c to the relay cluster through the message topic configured by the shard processing device 2c. The shard processing device 2c can obtain the configuration message related to the message topic configured by itself at the relay cluster. The configuration message may include the shard information n2. In this way, the shard processing device 2c can obtain the corresponding shard information n2 through the configuration message obtained from the relay cluster and process the shard information n2 (including storage and recording). Similarly, the principle of the first client distributing the corresponding shard information to other shard processing devices (such as shard processing devices 3c~Nc) through the relay cluster, as well as the process of message interaction between the first client and other shard processing devices through the relay cluster can refer to the above description and will not be repeated here.
[0045] By adopting the method provided in the present application, the first client can securely and reliably distribute the shard information of the client key of the second client to the corresponding shard processing devices through an open source (i.e., publicly accessible) and decentralized relay cluster, thereby realizing distributed processing of the client key of the second client at each shard processing device, thereby improving the security and reliability of processing the client key of the second client.
[0046] Please refer to Figure 3, which is a flow chart of a message processing method provided by the present application. The execution subject in the embodiment of the present application can be a first client, and the first client can be located in any message processing device. The message processing device can be a computer device or a computer device cluster composed of multiple computer devices. The computer device can be a server, a terminal device, or other devices, without limitation. As shown in Figure 3, the method can include steps S101 to S104:
[0047] Step S101, obtaining N shard information of the client key of the second client; N is a positive integer, and the N shard information is used to generate the client key of the second client; each shard information is processed by a corresponding shard processing device; the second client is set in any shard processing device.
[0048] Both the first client and the second client can be any client. Schematically, the first client and the second client can be application clients of a blockchain network. For example, the first client can be a Dapp (Decentralized Application), and the second client can be a resource client of the blockchain network. A resource client is a tool for managing and storing digital resources. The resource management business functions implemented by the resource client may include, for example, transferring digital resources (also known as business resources) to other accounts based on the resource client, or receiving digital resources transferred from other accounts based on the resource client. The resource client can be a hardware device or a software program. The resource client can be used to implement resource management business functions and, based on these resource management business functions, establish a communication connection with the decentralized application client. In one embodiment of the present application, the resource client (second client) can establish a communication connection with the decentralized application client (first client) to enable the decentralized application client (first client) to initiate resource transfer business data of the resource client (second client) on its behalf and submit the resource transfer business data to the resource client (second client) for signature and other related operations.
[0049] The first client may obtain a client key of the second client, which may be a private key of the second client. Optionally, the client key obtained by the first client may be input into the first client by a user of the second client (which may be referred to as a key holder), or may be generated in the first client by the user of the second client directly requesting it.
[0050] Optionally, in the present application, the first client may have a secure environment. For the security and privacy of the client key of the second client, the first client may process the relevant data of the client key in the secure environment. The secure environment may be an environment isolated from other environments in the first client (i.e., any environment other than the secure environment). The data in the secure environment are all confidential and invisible data. Schematically, the secure environment may be a TEE (Trusted Execution Environment) or a hardware security environment, etc. Therefore, the first client can obtain the client key of the second client in its secure environment, and can obtain N shard information of the client key in the secure environment, where N is a positive integer. The specific value of N can be determined according to the actual application scenario. The present application does not limit the value of N; the N shard information can be used to generate the client key of the second client.
[0051] The method for obtaining the N shards of the client key may be determined according to the actual application scenario. The following example describes a process in which a first client obtains the N shards of the client key of a second client. This process may be performed by the first client in a secure environment, as described in ①-③ below:
[0052] ① The first client can generate an M-1 degree polynomial based on the client key of the second client in a secure environment. A polynomial is usually an algebraic expression consisting of a constant term, a linear term, a quadratic term, etc., arranged in descending order of degree. An M-1 degree polynomial means that the highest degree of the polynomial is M-1; M is a positive integer, and M is less than N. For example, the client key of the second client can be represented as a0, and the above M-1 degree polynomial can be represented as y. Then the M-1 degree polynomial can be: y = a0 + a1·x + a2·x 2 +......+a M-1 ·x M-1 , where the highest degree of this polynomial is M-1, that is, the highest exponent is M-1; x is a variable, a0~a M-1 can be coefficients (can be constants); a1~a M-1 Can be any constant, x M-1 Represents x to the power of M-1.
[0053] ② In a secure environment, the first client can obtain N shards of the second client's client key based on the aforementioned M-1 degree polynomial. Specifically, the first client can generate a target curve in a secure environment based on the M-1 degree polynomial. This target curve is a curve representing the M-1 degree polynomial. The y above can represent the vertical axis of the target curve, and the x above can represent the horizontal axis of the target curve. Both x and y are variables, and y changes with changes in x. The vertical axis can represent the vertical coordinates of points on the target curve, and the horizontal axis can represent the horizontal coordinates of points on the target curve. The first client can obtain (randomly or arbitrarily) the coordinate information of N points on the target curve. The coordinate information of any point includes the value of the horizontal coordinate on the horizontal axis x and the value of the vertical coordinate on the vertical axis y of the point on the target curve. The first client can directly use the coordinate information of these N points as the N shards of the second client's client key. The coordinate information of each point constitutes one shard.
[0054] It can be understood that any point on the target curve can be a solution of the M-1 degree polynomial, and according to the Lagrange interpolation theorem, the M-1 degree polynomial can be solved through M solutions (i.e., M points), that is, the M-1 degree polynomial can be solved through the M points of the M-1 degree polynomial, that is, all the coefficients in the M-1 degree polynomial (such as the coefficients a0 to a1 in the above example) can be solved. M-1 ), since a0 in the M-1 degree polynomial represents the client key of the second client, solving for a0 also solves for the client key of the second client. The Lagrange interpolation theorem is a method for constructing polynomial interpolation functions. Using the Lagrange interpolation theorem, an interpolation polynomial that satisfies given points can be constructed. This interpolation polynomial can be used to perform interpolation calculations between given points to estimate the values of missing points. Therefore, it can be understood that the client key of the second client can be generated based on M of the N shards. Through the above process, the first client obtains the N shards of the client key of the second client.
[0055] ③Please also refer to Figure 4, which is a schematic diagram of a scenario for obtaining shard information provided by this application. As shown in Figure 4, the first client can generate a target curve using an M-1 degree polynomial, and the target curve is a curve formed by representing the M-1 degree polynomial.
[0056] The first client can take the coordinate information of N points on the target curve (for example, N can be 6, including the 6 points from point 1d to point 6d taken here) as the above-mentioned N shard information, that is, the coordinate information of one point is one shard information. Furthermore, there can be a one-to-one correspondence between the N shard information and the N shard processing devices. The so-called one-to-one correspondence means that each shard information is processed by a corresponding shard processing device, and different shard information is processed by corresponding different shard processing devices. The N shard processing devices can be N devices of any configuration for distributed processing of the client key of the second client. Optionally, the correspondence between the shard information and the shard processing device can be randomly determined. For example, by random determination, the shard information n1 in the N shard information can correspond to the shard processing device 1c, and the shard information n2 can correspond to the shard processing device 2c, and so on. This application does not impose any restrictions on this. The second client can be located in any of the N shard processing devices, that is, the second client can be used to process a shard information of its own client key; for example, the second client can be located in shard processing device 1c, then shard processing device 1c is the shard processing device to which the second client belongs, and the second client can process the shard information corresponding to shard processing device 1c (for example, shard information n1). The other shard processing devices among the N shard processing devices, except the shard processing device to which the second client belongs, can all be additionally configured service devices (such as servers).
[0057] Step S102, obtain the message topic configured for each shard processing device at the relay cluster; there is a relay connection relationship between the first client and each shard processing device, and the relay cluster is used to perform open source relay service operations between the first client and any shard processing device that has a relay connection relationship with the first client.
[0058] In this application, any object (such as a first client, a second client, or each shard processing device) can configure (or register) its own message topic (Topic) at the relay cluster. This message topic has a topic ID. Any object can transmit messages to other objects through the relay cluster based on the message topic configured by the other object. The message topic configured by the second client is also the message topic configured for the shard processing device to which the second client belongs.
[0059] In this application, the first client (i.e., Dapp) is supported to actively initiate a relay connection with each other object (including each shard processing device) to establish a relay connection relationship with each other object. Schematically, the second client (i.e., resource client) may not have the function of actively initiating a relay connection with other objects. In this case, this application can utilize the function of the first client to actively initiate a relay connection with other objects (such as each shard processing device) to conveniently distribute the shard information of the second client's client key to each shard processing device through the first client.
[0060] The first client can actively send the message topic it has configured to each shard processing device. For security reasons, the first client can send the message topic it has configured to each shard processing device offline. The so-called offline refers to activities or exchanges in the real world, as opposed to online, which refers to activities or exchanges on the network (Internet). For example, the first client can generate a QR code (which can be called a digital code). The QR code can encapsulate the message topic configured by the first client and the address of the relay cluster. Each shard processing device can scan the QR code to obtain the message topic configured by the first client and the address of the relay cluster. Schematically, the relay cluster can include multiple relay devices, the relay device can be a server, and the address of the relay cluster can be the server address of any relay device. Each shard processing device can configure its own message topic at the relay cluster using the address of the relay cluster it has obtained. Each shard processing device can also send its own configured message topic to the first client. For example, each shard processing device can also send it to the first client offline in the form of a QR code. The first client can save (i.e., record) the message topic configured by each shard processing device. Through the above process, the first client establishes a relay connection relationship with each shard processing device. The relay connection relationship established between the first client and any shard processing device is established (i.e., determined) through the message subject configured by the first client and the message subject configured by the any shard processing device. It can be understood that the message subject configured by the first client and the message subject configured by the any shard processing device together constitute the session (session control) between the first client and the any shard processing device, that is, the first client and the any shard processing device conduct a conversation (or communication) through the relay connection relationship established between the two.
[0061] Based on the above description, it can be known that the first client can obtain the message topic configured by each shard processing device at the relay cluster. It should be noted that the relay cluster in this application can be used to perform open source relay service operations between the first client and any shard processing device that has a relay connection relationship with the first client to provide open source relay services; for example, there is a relay connection relationship between the first client and the shard processing device 1c, then the relay cluster can perform open source relay service operations between the first client and the shard processing device 1c that have a relay connection relationship to provide open source relay services. For another example: there is a relay connection relationship between the first client and the shard processing device 2c, then the relay cluster can perform open source relay service operations between the first client and the shard processing device 2c that have a relay connection relationship to provide open source relay services. The so-called open source relay service can mean that the operations performed by the object through the relay cluster can be public and open source.
[0062] A relay cluster can be configured with multiple relay devices, which can be dedicated to a certain organization or enterprise, or any configured device. The relay service provided by the relay cluster can be a decentralized service provided by the multiple relay devices. The relay cluster only needs to maintain the message topics configured for each object (such as the first client, the second client, or the shard processing device) without knowing the actual identity information of each object. In other words, the relay cluster does not care who the object of the conversation is, nor does it care about the specific content of the message being transmitted. Therefore, the process of message interaction between each object through the relay connection relationship established at the relay service is secure and private.
[0063] In this application, an open source, decentralized relay service can be used to implement the interaction of messages of any custom type between objects with a relay connection relationship, that is, there is no restriction on the type of messages being interacted, and messages of any custom type can be interacted. Therefore, the flexibility of message interaction is high and the scope of adaptability is wide. In addition, the objects (such as the first client and multiple shard processing devices) that interact with messages through the open source relay service can be different types of terminals, such as browser terminals, software terminals, PC terminals (such as computer terminals), and mobile terminals (such as mobile phone terminals). That is, there is no restriction on the types of objects that interact with messages. This application can realize the connection and interaction between various types of objects through the open source relay service.
[0064] Illustratively, the relay cluster in this application can be maintained based on the resource connection protocol (WalletConnect, an open source protocol) (that is, the relay service can be provided by the resource connection protocol), or the relay cluster can also be a self-built open source cluster, and this application does not impose any restrictions on this.
[0065] Step S103: Generate a configuration message for each shard processing device according to the shard information corresponding to each shard processing device and the message topic configured for each shard processing device.
[0066] The first client can generate configuration messages for each shard processing device using the shard information corresponding to each shard processing device and the message topics configured for each shard processing device. The configuration messages for each shard processing device are configuration messages that set the message topics configured for each shard processing device, i.e., messages related to the message topics configured for each shard processing device. For example, the configuration message for shard processing device 1c is a message configured based on the message topic configured for shard processing device 1c, i.e., a message related to the message topic configured for shard processing device 1c.
[0067] In one embodiment, a communication key may exist between the first client and each shard processing device. Schematically, the communication key between the first client and any shard processing device may be a symmetric key. The communication key is used to encrypt the messages exchanged between the first client and the shard processing device to ensure the security of the exchanged messages. For example: a communication key may exist between the first client and the shard processing device 1c, and the communication key is used to encrypt the messages exchanged between the first client and the shard processing device 1c. Another example: a communication key may exist between the first client and the shard processing device 2c, and the communication key is used to encrypt the messages exchanged between the first client and the shard processing device 2c. The communication keys between the first client and different shard processing devices may be the same or different, and this application does not limit this.
[0068] Any of the N shard processing devices can be referred to as a target shard processing device. Since the principles for generating configuration messages for each shard processing device are the same, the following description will be made using generation of a configuration message for a target shard processing device as an example.
[0069] The first client can set a target shard processing device configuration message topic for the shard information corresponding to the target shard processing device, thereby generating an initial configuration message for the target shard processing device. The initial configuration message refers to the shard information with the target shard processing device configuration message topic set. For example, the first client adds the topic identifier (denoted as Topic ID) of the target shard processing device configuration message topic to the shard information ni corresponding to the target shard processing device, thereby generating an initial configuration message for the target shard processing device. The initial configuration message refers to the shard information ni with the TopicID.
[0070] The first client can use the communication key between itself and the target shard processing device to encrypt the initial configuration message of the target shard processing device to obtain the configuration message of the target shard processing device. The configuration message of the target shard processing device can be understood as the message configured by the target shard processing device at the relay cluster (a message obtained through the configured message topic, or a message related to the configured message topic).
[0071] Please refer to Figure 5, which is a schematic diagram of a scenario for generating a configuration message provided by the present application. As shown in Figure 5, the first client can configure the shard information corresponding to the target shard processing device through the message topic configured by the target shard processing device. For example, the shard information corresponding to the target shard processing device is set to the topic identifier of the message topic configured by the target shard processing device, thereby obtaining the initial configuration message of the target shard processing device. The first client can encrypt the initial configuration message using the communication key between the first client and the target shard processing device to obtain the configuration message of the target shard processing device.
[0072] Step S104: Send the generated N configuration messages to the relay cluster, so that each shard processing device obtains its own configuration message from the relay cluster and processes the corresponding shard information based on its own configuration message.
[0073] The first client may generate N configuration messages and send them to the relay cluster. In one embodiment, the first client may send the N configuration messages to any relay device in the relay cluster (e.g., the relay device closest to the first client). Upon receiving the N configuration messages, the relay device may broadcast (i.e., send) the N configuration messages to other relay devices in the relay cluster, so that each relay device can maintain the same and complete message.
[0074] Alternatively, in another embodiment, in order to reduce the pressure on a single relay device to broadcast configuration messages, the first client may also send N configuration messages to multiple relay devices. In one implementation of this embodiment, if the number of relay devices in the relay cluster is Z, where Z is a positive integer and Z is less than N, the first client may divide the N configuration messages into Z groups (which may be randomly and evenly grouped), which may be referred to as Z configuration message groups, each configuration message group containing at least one configuration message. The first client may send the Z configuration message groups to the Z relay devices in the relay cluster respectively, and one relay device may receive one configuration message group. Each relay device may broadcast the configuration message groups it has received to each other, and ultimately, each relay device may obtain N configuration messages. In another implementation of this embodiment, if Z is greater than N, the first client may not group the N configuration messages. The first client may send the N configuration messages to the N relay devices in the relay cluster respectively, and one relay device may receive one configuration message. Each relay device may also broadcast the configuration messages it has received to each other, so that each relay device may obtain N configuration messages.
[0075] After the relay cluster obtains N configuration messages, each shard processing device can obtain its own configuration message from the relay cluster and process the corresponding shard information based on the obtained configuration message. Take the target shard processing device obtaining shard information as an example:
[0076] After receiving the configuration message of the target shard processing device, the relay cluster can actively push the configuration message to the target shard processing device (such as pushing it through any relay device, such as pushing it through the relay device closest to the target shard processing device); or, the target shard processing device can actively pull its own configuration message from the relay cluster (such as pulling it from any relay device, such as pulling it from the relay device closest to the target shard processing device).
[0077] After obtaining its own configuration message, the target shard processing device can decrypt the obtained configuration message using the communication key between it and the first client to obtain the corresponding shard information. The target shard processing device can store and process the shard information.
[0078] Please refer to Figure 6, which is a schematic diagram of another message processing scenario provided by this application. As shown in Figure 6, it is assumed that N shard processing devices include shard processing devices 1 to shard processing devices 3, and the relay devices in the relay cluster include relay devices 1 to 4.
[0079] The first client can send N configuration messages to relay device 1 closest to itself in the relay cluster. Relay device 1 can broadcast the N configuration messages to relay device 2, relay device 3 and relay device 4, so that relay device 2, relay device 3 and relay device 4 can also obtain and save the N configuration messages.
[0080] The shard processing device 1 can obtain the configuration message of the shard processing device 1 sent by the first client from the relay device 2 closest to itself in the relay cluster. Through the configuration message, the shard processing device 1 can process the corresponding shard information.
[0081] Similarly, the shard processing device 2 can obtain the configuration message of the shard processing device 2 sent by the first client from the relay device 4 closest to itself in the relay cluster. Through the configuration message, the shard processing device 2 can process the corresponding shard information.
[0082] Similarly, the shard processing device 3 can obtain the configuration message of the shard processing device 3 sent by the first client from the relay device 3 closest to itself in the relay cluster. Through the configuration message, the shard processing device 3 can process the corresponding shard information.
[0083] In one embodiment, before the first client requests the relay cluster to configure its own message topic, it can also send a long connection establishment request to the relay cluster (such as to any relay device). The relay cluster can establish a long connection with the first client based on the long connection establishment request. If the long connection is disconnected, it can be reconnected at any time. When the relay cluster receives a new message related to the message topic configured by the first client (also referred to as the configuration message of the first client), it can send a new message prompt information to the first client based on the long connection established with the first client to prompt the first client that there is a new message. After obtaining the new message prompt information, the first client can pull the new message related to the message topic configured by the first client from the relay cluster (such as to any relay device, such as the relay device closest to the first client).
[0084] Illustratively, after the first client establishes a long connection with the relay cluster, when sending a message to the relay cluster (such as a configuration message of a shard processing device), it can also be based on the long connection established with the relay cluster to send a message to the relay cluster. After obtaining the address of the relay cluster through the first client, each of the above-mentioned shard processing devices can also establish a long connection with the relay cluster according to the same principle as above. Each shard processing device can also realize message interaction with the relay cluster through the long connection established with the relay cluster, such as obtaining its own configuration message from the relay cluster.
[0085] In the present application, since the client key of the second client can be generated using M of the N shard information, if at least M of the N shard processing devices are operating normally (i.e., a small number of shard processing devices may fail to operate normally), the client key of the second client can be generated, thereby improving the fault tolerance of recovering the client key of the second client. Furthermore, since the client key of the second client is distributedly stored and processed at the N shard processing devices using N shard information, if a malicious device (such as a shard processing device with fewer than M shards) obtains fewer than M shard information, it cannot generate the client key of the second client, thereby improving the security and privacy of processing the client key.
[0086] In the present application, a first client can obtain N shard information of the client key of a second client; the N shard information is used to generate the client key of the second client; each shard information is processed by a corresponding shard processing device; the second client is located in any shard processing device; it can be seen that since one shard information is processed by a corresponding shard processing device, the client key of the second client can be distributedly processed at multiple shard processing devices, thereby improving the security of the client key. In addition, the first client can also obtain the message topic configured by each shard processing device at the relay cluster; there is a relay connection relationship between the first client and each shard processing device. In this way, the first client can communicate and interact with each shard processing device through the relay connection relationship between the first client and each shard processing device. In addition, the relay cluster is used to perform open source relay service operations between the first client and any shard processing device that has a relay connection relationship with the first client. Then, the first client can securely distribute each shard information to each shard processing device based on the open source relay service operations performed by the relay cluster, thereby ensuring the security of distributing the shard information; in addition, the first client can generate a configuration message for each shard processing device based on the shard information corresponding to each shard processing device and the message topic configured for each shard processing device; and send the generated N configuration messages to the relay cluster, so that each shard processing device can obtain its own configuration message from the relay cluster and process the corresponding shard information based on its own configuration message. It can be seen that the first client generates a configuration message for each shard processing device based on the message topic configured by each shard processing device at the relay cluster, and distributes the configuration message of each shard processing device to each shard processing device through the relay function of the relay cluster. This realizes the communication interaction between the first client and each shard processing device, and realizes the convenient distribution of N shard information, so that the client key of the second client can be distributedly processed by N shard processing devices.
[0087] Please refer to Figure 7, which is a flowchart of a multi-terminal connection method provided by this application. As shown in Figure 7, the Dapp can be the first client mentioned above, the resource client can be the second client mentioned above, and the bridge can be the relay cluster mentioned above (which can also be understood as the relay service provided by the relay cluster). The method may include:
[0088] 1. Dapp can establish a socket connection (long connection) with the bridge.
[0089] 2. Dapp can generate Dapp Topic and Dapp Client by itself. The Dapp Topic can be the topic identifier of the message topic that the Dapp needs to configure in the relay service. The Dapp Client is an identifier of the Dapp in the relay service (the identifier of the terminal, which can be called the client identifier of the first client). This allows the subsequent bridge to identify the Dapp only through the Dapp Client without paying attention to the actual identity information of the Dapp. The Dapp can configure the Dapp Topic in the relay cluster.
[0090] 3. Dapp can send a Dapp Client login request to the Dapp Topic. This login request is used to request to log in to the resource client in the Dapp.
[0091] 4. Dapp can generate a QR code that contains the Dapp Topic, bridge address (such as server address), and symmetric key information (i.e., the communication key between the Dapp and the resource client). Dapp can provide the QR code to the resource client offline (without network connection) for scanning, so that the resource client can obtain the Dapp Topic, bridge address, and symmetric key information.
[0092] 5. After obtaining the Dapp Topic, bridge address, and symmetric key information, the resource client can also establish a socket connection (long connection) with the bridge.
[0093] 6. Resource clients can also generate resource topics (i.e., the topic identifier of the message topic that the resource client needs to configure in the relay cluster) and resource clients (i.e., an identifier of the resource client in the relay cluster, which can be called the client identifier of the resource client) on their own. Resource clients can configure both Dapp topics and resource topics in the relay cluster at the same time.
[0094] 7. The resource client can obtain the login request under the Dapp Topic from the relay cluster. The login request can be encrypted using symmetric key information and can carry the Dapp's identity information. The resource client can process the login request, such as verifying the Dapp's identity information in the login request, or popping up a pop-up window to ask the user to confirm whether to authorize the Dapp to log in to the resource client, to obtain the processing result for the login request. The processing result can be either authorization to authorize the Dapp to log in to the resource client or disapproval of authorization to authorize the Dapp to log in to the resource client.
[0095] 8. The resource client can send the processing result of the login request under the Dapp Topic to the relay cluster. The processing result can carry the resource client. The processing result can also be encrypted using the symmetric key information between the resource client and the Dapp.
[0096] 9. Dapp can obtain the processing result of the resource client's login request under its own configured Dapp Topic from the relay cluster. If the processing result is the result of authorizing Dapp to log in to the resource client, then Dapp can successfully log in to the resource client.
[0097] 10. Dapp can use the resource topic configured by the resource client to transmit messages to the resource client through the relay cluster.
[0098] 11. Resource clients can obtain messages delivered by Dapp through their own configured resource topics in the relay cluster.
[0099] Similarly, the resource client can also use the Dapp-configured Dapp Topic to pass messages to the Dapp through the relay cluster. The Dapp can then obtain the messages passed by the resource client through its own configured resource Topic at the relay cluster. In this way, the connection between the Dapp and the resource client (such as the relay connection) is established through the Dapp-configured Dapp Topic and the resource Topic configured by the resource client. That is, the Dapp-configured Dapp Topic and the resource Topic configured by the resource client together constitute the session between the Dapp and the resource client. Through the relay connection between the Dapp and the resource client in the decentralized relay cluster, reliable and secure message exchange between the Dapp and the resource client can be achieved subsequently.
[0100] Please refer to Figure 8, which is a flow chart of a business data processing method provided by this application. The execution subject of this embodiment of the application can also be the first client mentioned above. As shown in Figure 8, the method may include:
[0101] Step S201: Acquire resource transfer service data for a target service resource. The resource transfer service data is used to instruct to transfer the target service resource.
[0102] The second client can log in to the first client, and the user can initiate the resource transfer business data of the second client in the first client. The first client can give the resource transfer business data to the second client for signing. Among them, the second client is a resource client, and the second client can have a target business resource (which can be a digital resource). The first client can obtain (such as generate) the resource transfer business data for the target business resource. The resource transfer business data can be business data used to indicate the transfer processing of the target business resource. For example, the second client can belong to user 1, and the target business resource of the second client also belongs to user 1. Then, the resource transfer business data can be business data used to transfer the target business resource to another user (such as user 2).
[0103] Step S202: Set the message topic configured by the shard processing device to which the second client belongs at the relay cluster for the resource transfer service data to obtain a target configuration message.
[0104] The first client can set the message subject configured by the second client at the relay cluster for the resource transfer service data, and obtain the target configuration message of the second client, which is the resource transfer service data with the message subject configured by the second client set.
[0105] Step S203: Send the target configuration message to the relay cluster, so that the second client obtains the target configuration message from the relay cluster and signs the resource transfer service data in the target configuration message.
[0106] The first client can send the target configuration message to the relay cluster (in the same way as sending the configuration message of the above-mentioned shard processing device), so that the second client can obtain the target configuration message sent by the first client at the relay cluster. The target configuration message can also be a message encrypted by the first client using the communication key between the first client and the second client.
[0107] The second client can decrypt the target configuration message obtained from the relay cluster to obtain the resource transfer service data. The second client can sign the resource transfer service data to obtain the signed resource transfer service data. Optionally, after decrypting the resource transfer service data, the second client can output a query message, which is used to inquire whether the resource transfer service data should be signed. When the second client receives a confirmation operation from the user (such as the owner of the second client) in response to the query message, the second client can sign the resource transfer service data to obtain the signed resource transfer service data.
[0108] Among them, since the client key of the second client supports being generated through M shard information, and the second client itself corresponds to one shard information (shard information corresponding to the shard processing device to which the second client belongs), the second client can request to obtain the shard information of the client key from any M-1 shard processing devices among the N shard processing devices except the shard processing device to which the second client belongs, that is, M-1 shard information can be obtained from the M-1 shard processing devices. The M-1 shard information plus the shard information corresponding to the second client itself, the second client can obtain M shard information.
[0109] Optionally, the shard processing device to which the second client belongs may also include a secure environment. To ensure the security and privacy of the second client's client key, the second client can use the secure environment of the shard processing device to obtain M-1 shard information from the M-1 shard processing devices. The second client can also generate its own client key (e.g., a client private key) within this secure environment using the obtained M shard information. The second client can use this generated client key to sign (e.g., encrypt) the resource transfer service data, thereby obtaining the signed resource transfer service data.
[0110] The second client can set the message subject configured by the first client at the relay cluster for the signed resource transfer business data (such as adding the subject identifier of the message subject configured by the first client at the relay cluster) to obtain the initial configuration business data, and can use the communication key between the first client and the first client to encrypt the initial configuration business data to obtain the signed configuration message (that is, the encrypted and signed resource transfer business data).
[0111] The second client can send the signature configuration message to the relay cluster, and the first client can obtain the signature configuration message returned by the second client at the relay cluster. The first client can decrypt the signature configuration message to obtain the signed resource transfer business data. The first client can send the signed resource transfer business data to the blockchain network (which can have a consensus network), so that the blockchain network can process the signed resource transfer business data through the consensus network (such as verifying the signature through the client public key of the second client), and after the consensus on the signed resource transfer business data is successful, the target business resources can be transferred according to the instructions of the resource transfer business data, such as transferring the target business resources belonging to the above-mentioned user 1 to the account of user 2, and the resource transfer business data can be processed on the chain, that is, stored in the blockchain network.
[0112] Please refer to Figure 9, which is a schematic diagram of a business data processing scenario provided by this application. As shown in Figure 9:
[0113] 1. The first client may send a target configuration message of the second client to the relay cluster. The target configuration message is encrypted resource transfer service data with a message subject configured by the second client.
[0114] 2. The second client can obtain the target configuration message related to the message topic configured by itself from the relay cluster.
[0115] 3. The second client can decrypt the target configuration message to obtain resource transfer service data, and can sign the resource transfer service data in conjunction with the slice information processed by the other M-1 slice processing devices to obtain the signed resource transfer service data.
[0116] The second client may also set the message subject configured by the first client for the signed resource transfer service data, encrypt the set message to obtain a signed configuration message, and send the signed configuration message to the relay cluster.
[0117] 4. The first client can pull the signed configuration message sent by the second client at the relay cluster, and can decrypt the signed configuration message to obtain the signed resource transfer service data.
[0118] 5. The first client may send the signed resource transfer business data to the blockchain network for consensus on the chain, so as to complete the execution of the resource transfer business data in the blockchain network.
[0119] The method provided in this application can establish a connection between any two independent devices (such as the device where the first client is located and the device where the second client is located) through an open source, decentralized relay cluster, and conveniently and securely implement message exchange between the two independent devices. When this method is applied to blockchain scenarios, it is also possible to conveniently initiate the business data of the second client (such as resource transfer business data) in the first client, and through communication between the first and second clients based on the relay cluster, convenient and secure consensus on the business data can be achieved on the chain.
[0120] Please refer to Figure 10, which is a schematic diagram of the structure of a message processing device provided by the present application. The message processing device can be a computer program (including program code) running on a computer device. For example, the message processing device is an application software, and the message processing device can be used to execute the corresponding steps of the method provided in the embodiment of the present application. As shown in Figure 10, the message processing device 1 may include: a first acquisition module 11, a second acquisition module 12, a generation module 13, and a sending module 14.
[0121] A first acquisition module 11 is configured to acquire N pieces of shard information of a client key of a second client; N is a positive integer, and the N pieces of shard information are used to generate the client key; each piece of shard information is processed by a corresponding shard processing device; and the second client is located in any shard processing device;
[0122] The second acquisition module 12 is used to obtain the message topic configured by each shard processing device at the relay cluster; a relay connection relationship exists between the first client and each shard processing device, and the relay cluster is used to perform an open source relay service operation between the first client and any shard processing device that has a relay connection relationship with the first client;
[0123] A generating module 13 is configured to generate a configuration message for each shard processing device according to the shard information corresponding to each shard processing device and the message topic configured for each shard processing device;
[0124] The sending module 14 is configured to send the generated N configuration messages to the relay cluster, so that each shard processing device obtains its own configuration message from the relay cluster and processes corresponding shard information based on its own configuration message.
[0125] Optionally, the first client has a secure environment, and the first obtaining module 11 obtains N shard information of the client key of the second client in a manner including:
[0126] Obtain the client secret key in a secure environment;
[0127] Generate an M-1 degree polynomial based on the client key in a secure environment; M is a positive integer and M is less than N;
[0128] In a secure environment, N shard information is obtained based on an M-1 degree polynomial.
[0129] Optionally, the first obtaining module 11 obtains N shard information based on an M-1 degree polynomial in a secure environment, including:
[0130] In a secure environment, a target curve is generated based on an M-1 degree polynomial;
[0131] Obtain the coordinate information of N points on the target curve, and use the coordinate information of N points as N slice information;
[0132] The client key supports generation based on M shards out of N shards.
[0133] Optionally, the second client has target service resources; and the apparatus 1 is further configured to:
[0134] Acquire resource transfer service data for a target service resource, where the resource transfer service data is used to instruct transfer processing of the target service resource;
[0135] Setting a message topic configured by the shard processing device to which the second client belongs at the relay cluster for the resource transfer service data to obtain a target configuration message;
[0136] The target configuration message is sent to the relay cluster, so that the second client obtains the target configuration message at the relay cluster and signs the resource transfer service data in the target configuration message.
[0137] Optionally, the resource transfer service data belongs to service data in the blockchain network, and the target service resources belong to resources in the blockchain network; the above-mentioned device 1 is further used to:
[0138] Obtaining a signature configuration message returned by the second client from the relay cluster; the signature configuration message is obtained by the second client configuring the message topic configured by the first client at the relay cluster for the signed resource transfer service data, and sent to the relay cluster;
[0139] The resource transfer business data signed in the signature configuration message is sent to the blockchain network, so that the blockchain network can perform consensus processing on the resource transfer business data signed, and after successfully reaching consensus on the resource transfer business data signed, the target business resources are transferred according to the instructions of the resource transfer business data.
[0140] Optionally, the client key supports generation based on M fragment information out of N fragment information, where M is a positive integer and M is less than N. The method for the second client to sign the resource transfer service data in the target configuration message includes:
[0141] The second client obtains the corresponding shard information from M-1 shard processing devices; the M-1 shard processing devices refer to any M-1 shard processing devices among the shard processing devices corresponding to the N shard information, excluding the shard processing device to which the second client belongs;
[0142] The second client generates a client key based on the shard information corresponding to the shard processing device to which the second client belongs and the M-1 shard information obtained from the M-1 shard processing devices;
[0143] The second client signs the resource transfer service data in the target configuration message based on the generated client key.
[0144] Optionally, a communication key is provided between the first client and each shard processing device, and any one of the N shard processing devices is a target shard processing device;
[0145] The generation module 13 generates configuration messages for each of the N shard processing devices according to the shard information processed by the N shard processing devices and the message topics configured by the N shard processing devices, including:
[0146] For the shard information corresponding to the target shard processing device, set the message topic of the target shard processing device configuration, and generate an initial configuration message of the target shard processing device;
[0147] The communication key between the first client and the target shard processing device is used to encrypt the initial configuration message of the target shard processing device to obtain the configuration message of the target shard processing device.
[0148] Optionally, a communication key is provided between the first client and each shard processing device, and any shard processing device is represented as a target shard processing device; the communication key between the first client and the target shard processing device is a symmetric key, and the relay cluster includes multiple relay devices;
[0149] After the first client sends the generated configuration message of the target shard processing device to the relay cluster, the target shard processing device executes a method including:
[0150] The target shard processing device obtains the configuration message of the target shard processing device from any relay device in the relay cluster;
[0151] The target shard processing device uses the communication key between it and the first client to decrypt the acquired configuration message to obtain shard information corresponding to the target shard processing device.
[0152] Optionally, the relay cluster includes multiple relay devices; the sending module 14 sends the generated N configuration messages to the relay cluster in the following manner:
[0153] N configuration messages are sent to any relay device in the relay cluster, so that the relay device broadcasts the received N configuration messages to other relay devices in the relay cluster.
[0154] Optionally, the first client is configured with a corresponding message topic at the relay cluster;
[0155] The relay connection relationship established between the first client and any shard processing device is established based on the message topic configured by the first client at the relay cluster and the message topic configured by any shard processing device at the relay cluster;
[0156] The relay cluster includes multiple relay devices, and the open source relay service operations performed by the relay cluster include decentralized service operations performed by one or more relay devices in the relay cluster.
[0157] Optionally, the first client is configured with a message topic at the relay cluster; the apparatus 1 is further configured to:
[0158] Sending a persistent connection establishment request to the relay cluster, and establishing a persistent connection between the relay cluster and the first client based on the persistent connection establishment request;
[0159] Receiving new message prompt information sent by the relay cluster based on the persistent connection between the relay cluster and the first client; the new message prompt information is sent to the first client by the relay cluster when obtaining a new message related to the message topic configured by the first client;
[0160] Based on the new message prompt information, new messages related to the message topic configured by the first client are pulled from the relay cluster.
[0161] According to one embodiment of the present application, the steps involved in the message processing method shown in FIG3 can be performed by the various modules in the message processing device 1 shown in FIG10. For example, step S101 shown in FIG3 can be performed by the first acquisition module 11 in FIG10, and step S102 shown in FIG3 can be performed by the second acquisition module 12 in FIG10; step S103 shown in FIG3 can be performed by the generation module 13 in FIG10, and step S104 shown in FIG3 can be performed by the sending module 14 in FIG10.
[0162] In the present application, the first client can obtain N shard information of the client key of the second client; the N shard information is used to generate the client key of the second client; each shard information is processed by a corresponding shard processing device; the second client is set in any shard processing device; it can be seen that since each shard information is processed by a corresponding shard processing device, the client key of the second client can be distributedly processed at multiple shard processing devices, which can improve the security of the client key. In addition, the first client can also obtain the message topic configured by each shard processing device at the relay cluster; there is a relay connection relationship between the first client and each shard processing device. In this way, the first client can communicate and interact with each shard processing device through the relay connection relationship between the first client and each shard processing device. In addition, the relay cluster is used to perform open source relay service operations between the first client and any shard processing device that has a relay connection relationship with the first client. Then, the first client can securely distribute each shard information to each shard processing device based on the open source relay service operations performed by the relay cluster, thereby ensuring the security of distributing the shard information; in addition, the first client can generate a configuration message for each shard processing device based on the shard information corresponding to each shard processing device and the message topic configured for each shard processing device; and send the generated N configuration messages to the relay cluster, so that each shard processing device can obtain its own configuration message from the relay cluster and process the corresponding shard information based on its own configuration message. It can be seen that the first client generates a configuration message for each shard processing device based on the message topic configured by each shard processing device at the relay cluster, and distributes the configuration message of each shard processing device to each shard processing device through the relay function of the relay cluster. This realizes the communication interaction between the first client and each shard processing device, and realizes the convenient distribution of N shard information, so that the client key of the second client can be distributedly processed in N shard processing devices.
[0163] According to one embodiment of the present application, the various modules in the message processing device 1 shown in Figure 10 can be individually or all combined into one or several units to constitute, or one (or some) of the units can be further divided into multiple functionally smaller sub-units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In actual applications, the functions of a module can also be implemented by multiple units, or the functions of multiple modules can be implemented by one unit. In other embodiments of the present application, the message processing device 1 may also include other units. In actual applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0164] According to one embodiment of the present application, a message processing device 1 as shown in FIG10 can be constructed, and the message processing method of the embodiment of the present application can be implemented by running a computer program (including program code) capable of executing each step involved in the corresponding method as shown in FIG3 on a general-purpose computer device such as a computer including processing elements and storage elements such as a central processing unit (CPU), a random access memory medium (RAM), and a read-only memory medium (ROM). The computer program can be recorded on, for example, a computer-readable recording medium, and loaded into the computing device via the computer-readable recording medium and run therein.
[0165] Please refer to Figure 11, which is a schematic diagram of the structure of a computer device provided by this application. As shown in Figure 11, the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, in some embodiments, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and optionally the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may also be at least one storage device located away from the aforementioned processor 1001. As shown in Figure 11, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a device control application.
[0166] In the computer device 1000 shown in FIG11 , the network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an interface for user input; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0167] Obtain N shard information of the client key of the second client; N is a positive integer, and the N shard information is used to generate the client key; each shard information is processed by a corresponding shard processing device; the second client is located in any shard processing device;
[0168] Obtaining a message topic configured at the relay cluster for each shard processing device; a relay connection relationship exists between the first client and each shard processing device, and the relay cluster is used to perform an open source relay service operation between the first client and any shard processing device that has a relay connection relationship with the first client;
[0169] Generate a configuration message for each shard processing device according to the shard information corresponding to each shard processing device and the message topic configured for each shard processing device;
[0170] The generated N configuration messages are sent to the relay cluster, so that each shard processing device obtains its own configuration message from the relay cluster and processes corresponding shard information based on its own configuration message.
[0171] It should be understood that the computer device 1000 described in the embodiments of the present application can execute the description of the message processing method described in the embodiment corresponding to FIG. 3 above, and can also execute the description of the message processing device 1 described in the embodiment corresponding to FIG. 10 above, and will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated here.
[0172] In addition, it should be noted that the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the message processing device 1 mentioned above. When the processor executes the computer program, it can execute the description of the message processing method in the embodiment corresponding to Figure 3 above. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0173] As an example, the above-mentioned computer program can be deployed and executed on one computer device, or deployed and executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected by a communication network. Multiple computer devices distributed in multiple locations and interconnected by a communication network can constitute a blockchain network.
[0174] The computer-readable storage medium may be the message processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0175] The present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the description of the above-mentioned message processing method in the embodiment corresponding to Figure 3 above. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0176] The terms "first," "second," and the like in the description, claims, and drawings of the embodiments of the present application are used to distinguish between different objects, rather than to describe a specific order. In addition, the terms "comprising" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other steps and units inherent to such processes, methods, apparatuses, products, or devices.
[0177] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0178] The method and related apparatus provided in the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided in the embodiment of the present application, and specifically can be implemented by computer program instructions for each process and / or box of the method flow chart and / or structural diagram, and the combination of the process and / or box in the flow chart and / or block diagram. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the function specified in one process or multiple processes of the flow chart and / or one box or multiple boxes of the structural diagram. These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, and the instruction device implements the function specified in one process or multiple processes of the flow chart and / or one box or multiple boxes of the structural diagram. These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the structural diagram.
[0179] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A message processing method, It is characterized in that The method is applied to a first client, and the method includes: Obtain N shard information of the client key of the second client; N is a positive integer, and the N shard information is used to generate the client key; each shard information is processed by a corresponding shard processing device; the second client is set in any one of the shard processing devices; Obtaining a message topic configured at the relay cluster for each of the shard processing devices; a relay connection relationship exists between the first client and each of the shard processing devices, and the relay cluster is used to perform an open source relay service operation between the first client and any of the shard processing devices that have a relay connection relationship with the first client; Generate a configuration message for each shard processing device according to the shard information corresponding to each shard processing device and the message subject configured for each shard processing device; The generated N configuration messages are sent to the relay cluster, so that each of the shard processing devices obtains its own configuration message from the relay cluster, and processes the corresponding shard information based on its own configuration message.
2. The method according to claim 1, It is characterized in that The first client has a secure environment; The obtaining of N shard information of the client key of the second client includes: Obtaining the client key in the secure environment; Generate an M-1 degree polynomial based on the client key in the secure environment; M is a positive integer and M is less than N; In the secure environment, the N shard information is obtained based on the M-1 degree polynomial.
3. The method according to claim 2, It is characterized in that The acquiring the N shard information based on the M-1 degree polynomial in the security environment includes: In the security environment, generating a target curve based on the M-1 degree polynomial; Acquire coordinate information of N points on the target curve, and use the coordinate information of the N points as the N slice information; The client key supports being generated through M pieces of shard information among the N pieces of shard information.
4. The method according to any one of claims 1 to 3, It is characterized in that The second client has a target service resource; the method further includes: Acquire resource transfer service data for the target service resource, wherein the resource transfer service data is used to indicate transfer processing of the target service resource; The message subject configured by the shard processing device to which the second client belongs at the relay cluster is set for the resource transfer service data to obtain a target configuration message; The target configuration message is sent to the relay cluster, so that the second client obtains the target configuration message from the relay cluster and signs the resource transfer service data in the target configuration message.
5. The method according to claim 4, It is characterized in that The resource transfer service data belongs to service data in the blockchain network, and the target service resources belong to resources in the blockchain network; the method further includes: Obtaining a signature configuration message returned by the second client from the relay cluster; the signature configuration message is obtained by the second client after setting the message subject configured by the first client at the relay cluster for the signed resource transfer service data, and sending it to the relay cluster; The resource transfer business data signed in the signature configuration message is sent to the blockchain network, so that the blockchain network performs consensus processing on the resource transfer business data signed, and after the consensus is successful, the target business resources are transferred according to the instructions of the resource transfer business data.
6. The method according to any one of claims 4 to 5, It is characterized in that The client key supports generation through M pieces of shard information among the N pieces of shard information, where M is a positive integer and M is less than N; The method for the second client to sign the resource transfer service data in the target configuration message includes: The second client obtains corresponding shard information from M-1 shard processing devices; The M-1 shard processing devices refer to any M-1 shard processing devices, among the shard processing devices corresponding to the N shard information, except the shard processing device to which the second client belongs; The second client generates the client key based on the shard information corresponding to the shard processing device to which the second client belongs and the M-1 shard information obtained from the M-1 shard processing devices; The second client signs the resource transfer service data in the target configuration message based on the generated client key.
7. The method according to any one of claims 1 to 6, It is characterized in that There is a communication key between the first client and each of the shard processing devices, and any of the shard processing devices is represented as a target shard processing device; Generating a configuration message of the target shard processing device according to the shard information corresponding to the target shard processing device and the message subject configured by the target shard processing device, including: For the shard information corresponding to the target shard processing device, set the message subject configured by the target shard processing device, Generate an initial configuration message for the target shard processing device; The initial configuration message of the target shard processing device is encrypted using the communication key between the first client and the target shard processing device to obtain the configuration message of the target shard processing device.
8. The method according to any one of claims 1 to 7, It is characterized in that There is a communication key between the first client and each of the shard processing devices, and any of the shard processing devices is represented as a target shard processing device; the communication key between the first client and the target shard processing device is a symmetric key, and the relay cluster includes multiple relay devices; After the first client sends the generated configuration message of the target shard processing device to the relay cluster, the method performed by the target shard processing device includes: The target shard processing device obtains a configuration message of the target shard processing device from any one of the relay devices in the relay cluster; The target shard processing device uses the communication key between the target shard processing device and the first client to decrypt the acquired configuration message to obtain shard information corresponding to the target shard processing device.
9. The method according to any one of claims 1 to 8, It is characterized in that The relay cluster includes multiple relay devices; The sending the generated N configuration messages to the relay cluster includes: The generated N configuration messages are sent to any one of the relay devices in the relay cluster, so that the any one of the relay devices broadcasts the received N configuration messages to other relay devices in the relay cluster.
10. The method according to any one of claims 1 to 9, It is characterized in that The first client is configured with a message topic at the relay cluster; The relay connection relationship between the first client and any one of the shard processing devices is established based on a message topic configured by the first client at the relay cluster and a message topic configured by any one of the shard processing devices at the relay cluster; The relay cluster includes multiple relay devices, and the open source relay service operation performed by the relay cluster includes a decentralized service operation performed by one or more of the relay devices in the relay cluster.
11. The method according to any one of claims 1 to 10, It is characterized in that The first client is configured with a message topic at the relay cluster; the method further includes: Sending a persistent connection establishment request to the relay cluster, and establishing a persistent connection between the relay cluster and the first client based on the persistent connection establishment request; receiving new message prompt information sent by the relay cluster based on the persistent connection between the relay cluster and the first client; the new message prompt information is sent by the relay cluster to the first client when a new message related to a message topic configured by the first client is acquired; Based on the new message prompt information, new messages related to the message topic configured by the first client are pulled from the relay cluster.
12. A message processing device, It is characterized in that The device is applied to a first client, and the device includes: A first acquisition module is used to acquire N shard information of the client key of the second client; N is a positive integer, and the N shard information is used to generate the client key; each shard information is processed by a corresponding shard processing device; the second client is set in any one of the shard processing devices; A second acquisition module is used to obtain a message topic configured at the relay cluster for each of the shard processing devices; a relay connection relationship exists between the first client and each of the shard processing devices, and the relay cluster is used to perform an open source relay service operation between the first client and any of the shard processing devices that have a relay connection relationship with the first client; A generating module, configured to generate a configuration message for each of the shard processing devices according to the shard information respectively corresponding to each of the shard processing devices and the message subject respectively configured for each of the shard processing devices; The sending module is used to send the generated N configuration messages to the relay cluster, so that each of the shard processing devices obtains its own configuration message from the relay cluster and processes the corresponding shard information based on the respective configuration message.
13. A computer program product, It is characterized in that The computer program product comprises a computer program, which is stored in a computer-readable storage medium. A processor of a computer device reads and executes the computer program from the computer-readable storage medium, so that the computer device executes the method according to any one of claims 1 to 11.
14. A computer device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 11.
15. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Message queue design method and device based on blockchain
CN111526047A
Data storage method and device, equipment and storage medium
CN112988764A
Key management method and device based on block chain
CN115118434A
Supervisable cross-chain private data sharing method and device
CN115242555A
Message processing method and device, product, equipment and medium
CN116980115A
