CN115484027A - Token application linear consistency method and device based on bos chain - Google Patents

Token application linear consistency method and device based on bos chain Download PDF

Info

Publication number
CN115484027A
CN115484027A CN202110661522.6A CN202110661522A CN115484027A CN 115484027 A CN115484027 A CN 115484027A CN 202110661522 A CN202110661522 A CN 202110661522A CN 115484027 A CN115484027 A CN 115484027A
Authority
CN
China
Prior art keywords
token
application
uplink
message
chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110661522.6A
Other languages
Chinese (zh)
Other versions
CN115484027B (en
Inventor
叶可可
张晶
徐海勇
陈国�
刘虹
张晓京
夏敬侃
初瑞
张琰
王莹
周成
张湘海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202110661522.6A priority Critical patent/CN115484027B/en
Publication of CN115484027A publication Critical patent/CN115484027A/en
Application granted granted Critical
Publication of CN115484027B publication Critical patent/CN115484027B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/321Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
    • H04L9/3213Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a token application linear consistency method and a token application linear consistency device based on a bos chain, which comprise the following steps: based on a message queue MQ distributed transaction mechanism, sending the received token application request to a message queue MQ, and storing the application state of the current token; executing a token uplink program based on the token application request, recording the token uplink state after the token uplink is successful, and sending the message of successful uplink; updating the application state of the first token based on the successful uplink information; and after the uplink is successful, waiting for receiving the message confirmed by the message queue MQ transaction, updating the application state of the token for the second time, coding the block number into the token, and sending a token application result. The invention effectively solves the problem of the linear consistency of the whole network token application.

Description

Token application linear consistency method and device based on bos chain
Technical Field
The invention relates to the technical field of computers, in particular to a token application linear consistency method and device based on a bos chain.
Background
Currently, the authorized access process of the basic service platform is that when a service user or a service provider is checked by the basic service platform, the api and the secret code are obtained. And initiating an authorization request to the basic service platform by carrying the api and the secret code, and fingerprinting through MD 5. And after authenticating the authorization application, the basic service platform returns to the token. After receiving the token, the service user or the service provider can access the platform open service within the valid period.
After receiving the authorization application and passing the authentication, the current basic service platform synchronizes the token to the nodes of the whole network through the block chain, notifies the application of the whole network through the zookeeper, and updates the local cache of the application. The access platform may access the mesh SN province node nearby.
The data consistency problem of token whole network synchronization can be solved to a certain extent through a block chain technology, but the linear consistency problem of the whole transaction link still exists.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a token application linear consistency method and device based on a bos chain.
In a first aspect, an embodiment of the present invention provides a token application linear consistency method based on a bos chain, including:
based on a message queue MQ distributed transaction mechanism, sending the received token application request to a message queue MQ, and storing the application state of the current token;
executing a token uplink program based on the token application request, recording the token uplink state after the token uplink is successful, and sending a message that the token uplink is successful;
based on the successful uplink information, updating the application state of the first token;
and after the uplink is successful, waiting for receiving the message confirmed by the message queue MQ transaction, updating the application state of the token for the second time, coding the block number into the token, and sending the application result of the token.
Further, the method also comprises the following steps:
and inquiring the token application processing progress through a token application state inquiry interface.
Further, still include:
and acquiring the block number based on a zookeeper notification of a distributed service frame, selecting block link points meeting preset conditions by using a load balancing algorithm to determine token information, and updating an application local memory.
Further, still include:
and checking the token version of the local token regularly, and if the token version is found to be outdated, pulling token information from the block chain network.
Further, the method also comprises the following steps:
if the token information is verified to be failed, checking whether the local application token version is expired;
if yes, triggering an asynchronous updating mechanism to continuously pull token information from the block chain network; if not, returning the token failed information.
Further, still include:
and sending the received token application request to a message queue MQ based on a message queue MQ distributed transaction mechanism, and returning the token application to the application party after the application state of the current token is stored, wherein the token application is successfully received and the message is being processed.
Further, the performing a token uplink procedure based on the token application request, recording the token uplink state after the token uplink is successfully performed, and sending a message that the token uplink is successfully performed, further includes:
and executing a token uplink application program based on the token application request, recording the token uplink state after the token uplink is successfully performed, sending an acknowledgement character ACK message and a message of successful uplink, and waiting for an acknowledgement message corresponding to the first token application state update.
In a second aspect, an embodiment of the present invention provides a token application linear consistency apparatus based on a bos chain, including:
the first module is used for sending the received token application request to a message queue MQ based on a message queue MQ distributed transaction mechanism and storing the application state of the current token;
a second module, configured to execute a token uplink procedure based on the token application request, record a token uplink state after the token uplink is successfully performed, and send a message that the token uplink is successfully performed;
a third module, configured to update an application state of the token for the first time based on the successful uplink information;
and the fourth module is used for waiting for receiving the message confirmed by the message queue MQ transaction after the uplink is successful, updating the application state of the token for the second time, coding the block number into the token, and sending the token application result.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the bos chain-based token application linear consistency method according to the first aspect when executing the program.
In a fourth aspect, the present invention further provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the bos chain based token application linear consistency method as described in the first aspect above.
According to the technical scheme, the method and the device for applying the linear consistency to the token based on the bos chain send the received token application request to the message queue MQ through the message queue MQ-based distributed transaction mechanism, and store the application state of the current token; executing a token uplink program based on the token application request, recording the token uplink state after the token uplink is successful, and sending a message that the token uplink is successful; based on the successful uplink information, updating the application state of the first token; and after the uplink is successful, waiting for receiving the message confirmed by the message queue MQ transaction, updating the application state of the token for the second time, coding the block number into the token, and sending the application result of the token, thereby effectively solving the problem of linear consistency of the whole network token application.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a token application linear consistency method based on a bos chain according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a token application linear consistency method based on a bos chain according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a token application linear consistency apparatus based on a bos chain according to an embodiment of the present invention;
fig. 4 is a schematic physical structure diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. The token applying linear consistency method based on bos chain provided by the present invention will be explained and illustrated in detail by specific embodiments.
Fig. 1 is a schematic flowchart of a token application linear consistency method based on a bos chain according to an embodiment of the present invention; as shown in fig. 1, the method includes:
step 101: and sending the received token application request to a message queue MQ based on a message queue MQ distributed transaction mechanism, and storing the application state of the current token.
Step 102: and executing a token uplink program based on the token application request, recording the token uplink state after the token uplink is successful, and sending a message that the token uplink is successful.
Step 103: and updating the application state of the first token based on the information of successful uplink.
Step 104: and after the uplink is successful, waiting for receiving the message confirmed by the message queue MQ transaction, updating the application state of the token for the second time, coding the block number into the token, and sending a token application result.
In the embodiment of the present invention, it should be noted that, for the "linear consistency problem of the whole transaction link exists" described in the background art, the following steps are performed: 1. since the transmission of the authorization code through the blockchain requires a certain amount of time, the zookeeper notification as a whole is faster than the transmission of the authorization code through the blockchain. When a plurality of block chain nodes are loaded in a server load balancing mode, the SN nodes of the mesh network read the latest token, and the other SN nodes still read the old token. This does not comply with the linear consistency constraint; 2. the frequent application may be caused when the token application initiated by the access platform fails; or a multi-threaded parallel application, message ordering problems can arise.
In the embodiment of the invention, it can be understood that, after receiving the token application and passing the authentication, the basic service platform sends the token request to the MQ, records messages such as the processing state of the token application and the like in the local database, and returns the messages to the applicant that the token application is successfully received and is being processed. When the downstream token cochaining procedure receives the MQ message, the token cochaining service logic is executed, after the token cochaining is performed, the token cochained is sent to the MQ, and a confirmed message (namely a message for confirming that the application state of the first token is updated) is waited; asynchronously monitoring uplink results of the block chain token, and after obtaining the uplink results of the token, sending the uplink results and the block numbers to the MQ; and after the basic service platform application receives the MQ message, updating the token application processing state of the local database. And after the transaction uplink result is received and the local database is updated successfully, the application party is informed that the token application is processed through the callback interface of the application party. And simultaneously, an application progress inquiry interface is provided for an applicant to inquire the application progress.
And deploying a monitoring program in the SN cluster, receiving the successful information of the MQ token uplink, and monitoring the block chain nodes in the current cluster. And sending a notice that the token is updated to the application in the cluster through the zookeeper. After the application in the cluster receives the notification, a proper block chain node is selected through a load balancing algorithm according to the block number to which the received authorization code belongs, and the local token information of the application is updated.
And after the token is recoded, the corresponding block number is coded into the token and then returned to the applicant.
When the SN node of the mesh network finds that the token of the transaction initiator is invalid, whether the local token information version is newer than the token version of the transaction initiator is verified, if the local token information version is newer than the token version of the transaction initiator, the token is invalid, and if the local token information version is older than the token version of the transaction initiator, the token information is updated again.
As can be seen from the above technical solutions, in the token application linear consistency method based on the bos chain provided in the embodiments of the present invention, the received token application request is sent to the message queue MQ through the message queue MQ-based distributed transaction mechanism, and the application state of the current token is stored; executing a token uplink program based on the token application request, recording the token uplink state after the token uplink is successful, and sending a message that the token uplink is successful; updating the application state of the first token based on the successful uplink information; and after the uplink is successful, waiting for receiving the message confirmed by the message queue MQ transaction, updating the application state of the token for the second time, coding the block number into the token, and sending the application result of the token, thereby effectively solving the problem of linear consistency of the token application in the whole network.
On the basis of the above embodiment, in this embodiment, the method further includes:
and inquiring the token application processing progress through a token application state inquiry interface.
In this example, for example, if the applicant waits for a period of time and does not receive the token application result, the token application processing progress may be queried through the token application state query interface.
According to the technical scheme, the token application linear consistency method based on the bos chain can enable an applicant to effectively monitor the token application processing progress.
On the basis of the above embodiment, in this embodiment, the method further includes:
and based on the notification of the distributed service framework zookeeper, acquiring the block number, selecting block link points meeting preset conditions by using a load balancing algorithm to determine token information, and updating and applying a local memory.
In this example, for example, block transaction event listeners deployed in various large areas listen to a block link network token transaction event. After receiving a token transaction event, sending a notification to a zookeeper, after receiving the zookeeper notification, selecting a block chain node meeting conditions according to the number of the block where the token transaction is located, which is obtained through the notification, by using a load balancing algorithm, and obtaining the latest token information from a block chain network, and updating an application local memory.
According to the technical scheme, the token application linear consistency method based on the bos chain, provided by the embodiment of the invention, combines MQ, block chain, zookeeper and load balancing technology to realize token application linear consistency access.
On the basis of the above embodiment, in this embodiment, the method further includes:
and checking the token version of the local token regularly, and if the token version is found to be outdated, pulling token information from the block chain network.
In this example, the local token version is checked periodically, as by an intra-cluster application, for example, and if found to be outdated, the latest token information is pulled from the blockchain network.
According to the technical scheme, the token application linear consistency method based on the bos chain can regularly check the local token version, so that the latest token information is pulled from the block chain network when the token is found to be outdated
On the basis of the above embodiment, in this embodiment, the method further includes:
if the token information is verified to be failed, checking whether the local application token version is expired;
if yes, triggering an asynchronous updating mechanism to continue to pull token information from the block chain network; if not, returning the information that the token has failed.
In this example, for example, as an intra-cluster application, after the token is verified to be invalid, the local application token version is checked for expiration, and if the local application token version is expired, an asynchronous update mechanism is triggered to pull the latest token information from the block chain. If not, the token expired information is returned.
On the basis of the above embodiment, in this embodiment, the method further includes:
and sending the received token application request to a message queue MQ based on a message queue MQ distributed transaction mechanism, and returning the token application to the application party after the application state of the current token is stored, wherein the token application is successfully received and the message is being processed.
According to the technical scheme, the token based on the bos chain applies the linear consistency method, so that an applicant can know that a token application is successfully received and a message is being processed.
On the basis of the foregoing embodiment, in this embodiment, the executing a token uplink procedure based on the token application request, recording a token uplink state after the uplink is successful, and sending a message that the uplink is successful further includes:
and executing a token uplink application program based on the token application request, recording the token uplink state after the token uplink is successfully performed, sending an acknowledgement character ACK message and a message of successful uplink, and waiting for an acknowledgement message corresponding to the first token application state update.
For better understanding of the present invention, the following examples are provided to further illustrate the present invention, but the present invention is not limited to the following examples, and refer to fig. 2.
1. The basic service platform receives the token application, sends the token application request to the MQ based on the MQ distributed transaction mechanism, and stores the token application state in the local database. And after the transaction is completed, returning the application token application which is successfully received and is processing the message to the initiator.
2. And the token uplink procedure receives the token application message, executes the token uplink procedure, records the token uplink state in the local database after the uplink is successful, and sends an ACK message to the MQ. And meanwhile, sending a message of successful uplink transmission to the MQ and waiting for confirmation.
3. And after receiving the successful uplink information from the MQ, the basic service platform updates the token application state.
4. And the token chaining result monitoring program monitors the block chain token transaction and sends a successful chaining token transaction message to the MQ.
5. After receiving the message confirmed by the MQ transaction, the basic service platform application updates the local token application state, encodes the block number + offset into the token, and sends a token application result to the applicant through the applicant callback interface.
6. And the applicant waits for a period of time and can inquire the token application processing progress through the token application state inquiry interface when the token application result is not received.
7. And a block transaction event monitoring program arranged in each large area monitors a block chain network token transaction event. After receiving a token transaction event, sending a notification to a zookeeper, after receiving the zookeeper notification, selecting a block chain node meeting conditions according to the number of the block where the token transaction is located, which is obtained through the notification, by using a load balancing algorithm, and obtaining the latest token information from a block chain network, and updating an application local memory.
8. The applications in the cluster periodically check the local token version and pull the latest token information from the blockchain network if it is found out to be outdated.
9. And the application in the cluster checks whether the local application token version is expired or not after the token is verified to be invalid, and if so, an asynchronous updating mechanism is triggered to pull the latest token information from the block chain. If not, the token expired information is returned.
The embodiment of the invention ensures the consistency of the data of the uplink link by using distributed affairs; carrying out transaction sequencing by using a block chain technology; and the token application linear consistency access is realized by combining MQ, a block chain, a zookeeper (confirmation character) and a load balancing technology.
In summary, the embodiments of the present invention effectively solve the problem that after token uplinking is successful, an SN node reads an inconsistent data view, and on the other hand, by using a combination of MQ (message Queue) and block chain technology, solve the problem of transaction sequentiality caused by network congestion and other situations.
Fig. 3 is a schematic structural diagram of a token application linear consistency apparatus based on a bos chain according to an embodiment of the present invention, as shown in fig. 3, the apparatus includes: a first module 201, a second module 202, a third module 203, and a fourth module 204, wherein:
the first module 201 is configured to send a received token application request to a message queue MQ based on a message queue MQ distributed transaction mechanism, and store an application state of a current token;
a second module 202, configured to execute a token uplink procedure based on the token application request, record a token uplink state after the token uplink is successfully performed, and send a message that the token uplink is successfully performed;
a third module 203, configured to update an application state of the first token based on the information that the uplink is successful;
the fourth module 204 is configured to wait for receiving a message confirmed by the message queue MQ transaction after the uplink is successful, update the application state of the token for the second time, encode the block number into the token, and send a token application result.
The bos chain-based token application linear consistency device provided in the embodiment of the present invention may be specifically configured to execute the bos chain-based token application linear consistency method in the above embodiment, and the technical principle and the beneficial effects thereof are similar, and reference may be specifically made to the above embodiment, which is not described herein again.
Based on the same inventive concept, an embodiment of the present invention provides an electronic device, and referring to fig. 4, the electronic device specifically includes the following contents: a processor 301, a communication interface 303, a memory 302, and a communication bus 304;
the processor 301, the communication interface 303 and the memory 302 complete communication with each other through the communication bus 304; the communication interface 303 is used for realizing information transmission between related devices such as modeling software, an intelligent manufacturing equipment module library and the like; the processor 301 is used for calling the computer program in the memory 302, and the processor executes the computer program to implement the method provided by the above method embodiments, for example, the processor executes the computer program to implement the following steps: based on a message queue MQ distributed transaction mechanism, sending the received token application request to a message queue MQ, and storing the application state of the current token; executing a token uplink program based on the token application request, recording the token uplink state after the token uplink is successful, and sending a message that the token uplink is successful; based on the successful uplink information, updating the application state of the first token; and after the uplink is successful, waiting for receiving the message confirmed by the message queue MQ transaction, updating the application state of the token for the second time, coding the block number into the token, and sending the application result of the token.
Based on the same inventive concept, yet another embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the method provided by the above method embodiments when executed by a processor, for example, based on a message queue MQ distributed transaction mechanism, sending a received token application request to a message queue MQ, and saving an application state of a current token; executing a token uplink program based on the token application request, recording the token uplink state after the token uplink is successful, and sending the message of successful uplink; updating the application state of the first token based on the successful uplink information; and after the uplink is successful, waiting for receiving the message confirmed by the message queue MQ transaction, updating the application state of the token for the second time, coding the block number into the token, and sending the application result of the token.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
In addition, in the present invention, terms such as "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless explicitly specified otherwise.
Moreover, in the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
Furthermore, in the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A token application linear consistency method based on a bos chain is characterized by comprising the following steps:
based on a message queue MQ distributed transaction mechanism, sending the received token application request to a message queue MQ, and storing the application state of the current token;
executing a token uplink program based on the token application request, recording the token uplink state after the token uplink is successful, and sending the message of successful uplink;
based on the successful uplink information, updating the application state of the first token;
and after the uplink is successful, waiting for receiving the message confirmed by the message queue MQ transaction, updating the application state of the token for the second time, coding the block number into the token, and sending a token application result.
2. The bos chain-based token application linear consistency method of claim 1, further comprising:
and inquiring the token application processing progress through a token application state inquiry interface.
3. The bos chain-based token applying linear consistency method of claim 1, further comprising:
and acquiring the block number based on a zookeeper notification of a distributed service frame, selecting block link points meeting preset conditions by using a load balancing algorithm to determine token information, and updating an application local memory.
4. The bos chain-based token application linear consistency method of claim 3, further comprising:
and checking the token version of the local token regularly, and if the token version is found to be outdated, pulling token information from the block chain network.
5. The bos chain-based token application linear consistency method of claim 4, further comprising:
if the token information is verified to be failed, checking whether the local application token version is overdue or not;
if yes, triggering an asynchronous updating mechanism to continuously pull token information from the block chain network; if not, returning the token failed information.
6. The bos chain-based token application linear consistency method of claim 1, further comprising:
and sending the received token application request to a message queue MQ based on a message queue MQ distributed transaction mechanism, and returning the token application to the application party after the application state of the current token is stored, wherein the token application is successfully received and the message is being processed.
7. The method of claim 1, wherein the method for applying linear consistency to the token based on the bos chain comprises performing a token uplink application request, recording a token uplink state after the token uplink application request is successfully uplink, and sending a message that the token uplink application request is successfully uplink, and further comprising:
and executing a token uplink program based on the token application request, recording the token uplink state after the token uplink is successful, sending an Acknowledgement Character (ACK) message and a message of successful uplink, and waiting for an acknowledgement message corresponding to the first token application state update.
8. A token application linear consistency apparatus based on bos chain, comprising:
the first module is used for sending the received token application request to a message queue MQ based on a message queue MQ distributed transaction mechanism and storing the application state of the current token;
a second module, configured to execute a token uplink procedure based on the token application request, record a token uplink state after the token uplink is successfully performed, and send a message that the token uplink is successfully performed;
a third module, configured to update an application state of a first token based on the successful uplink message;
and the fourth module is used for waiting for receiving the message confirmed by the message queue MQ transaction after the uplink is successful, updating the application state of the token for the second time, coding the block number into the token, and sending the token application result.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the bos chain based token application linear consistency method as claimed in any one of claims 1 to 7 when executing the program.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the bos chain based token application linear consistency method of any of claims 1 to 7.
CN202110661522.6A 2021-06-15 2021-06-15 Token application linear consistency method and device based on bos chain Active CN115484027B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110661522.6A CN115484027B (en) 2021-06-15 2021-06-15 Token application linear consistency method and device based on bos chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110661522.6A CN115484027B (en) 2021-06-15 2021-06-15 Token application linear consistency method and device based on bos chain

Publications (2)

Publication Number Publication Date
CN115484027A true CN115484027A (en) 2022-12-16
CN115484027B CN115484027B (en) 2024-06-25

Family

ID=84419260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110661522.6A Active CN115484027B (en) 2021-06-15 2021-06-15 Token application linear consistency method and device based on bos chain

Country Status (1)

Country Link
CN (1) CN115484027B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110011996A (en) * 2019-03-26 2019-07-12 阿里巴巴集团控股有限公司 Application authorization method and device and electronic equipment based on block chain
US20200184469A1 (en) * 2018-12-07 2020-06-11 0Chain, LLC Systems and methods of blockchain for transaction rewards on token locking
US20200213127A1 (en) * 2018-12-27 2020-07-02 Paypal, Inc. Blockchain management system
CN112565293A (en) * 2020-12-23 2021-03-26 平安养老保险股份有限公司 Information security management method and device, computer equipment and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200184469A1 (en) * 2018-12-07 2020-06-11 0Chain, LLC Systems and methods of blockchain for transaction rewards on token locking
US20200213127A1 (en) * 2018-12-27 2020-07-02 Paypal, Inc. Blockchain management system
CN110011996A (en) * 2019-03-26 2019-07-12 阿里巴巴集团控股有限公司 Application authorization method and device and electronic equipment based on block chain
CN112565293A (en) * 2020-12-23 2021-03-26 平安养老保险股份有限公司 Information security management method and device, computer equipment and readable storage medium

Also Published As

Publication number Publication date
CN115484027B (en) 2024-06-25

Similar Documents

Publication Publication Date Title
CN110956474B (en) Electronic invoice system based on block chain
US6957212B2 (en) Apparatus and methods for intelligently caching applications and data on a gateway
CN111291060B (en) Method, device and computer readable medium for managing blockchain nodes
US9633099B2 (en) Core data synchronization systems and methods
CN111447069B (en) Low-frequency access data processing method based on block chain
US9021503B2 (en) Coordinating application state and communication medium state
CN112235423A (en) Cross-chain transaction processing method and device, electronic equipment and storage medium
EP2309389A1 (en) Delivery with reconciliation on client side
CN111338834B (en) Data storage method and device
CN112650812A (en) Data fragment storage method and device, computer equipment and storage medium
CN113179301A (en) File downloading method and device, storage medium and electronic device
US8458725B2 (en) Computer implemented method for removing an event registration within an event notification infrastructure
CN111161072A (en) Block chain-based random number generation method, equipment and storage medium
CN114637611A (en) Information processing method and device based on message queue and computer equipment
CN113014618B (en) Message processing method and system and electronic equipment
CN112905930A (en) Interface request retransmission method and device
CN115484027B (en) Token application linear consistency method and device based on bos chain
CN112749172A (en) Data synchronization method and system between cache and database
CN115190125A (en) Monitoring method and device for cache cluster
CN116263926A (en) Accounting method, device and system based on blockchain
CN112182003A (en) Data synchronization method and device
CN113783666B (en) Method and device for processing business
CN111212276A (en) Monitoring method, system, equipment and storage medium based on camera module
CN111833014A (en) Public accumulation fund transfer processing method and device based on block chain
CN115242499B (en) Network request method, network request device, electronic device, and storage medium

Legal Events

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