A data chaining method, system, device and computer readable storage medium

By selecting less than a preset number of data items to be uploaded to the blockchain as target data and requesting storage on the blockchain platform, the problem of low data uploading efficiency in existing technologies is solved, and parallel uploading of multiple data items to the blockchain is achieved, thus improving overall efficiency.

CN114896338BActive Publication Date: 2026-05-05YGSOFT INC
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YGSOFT INC
Filing Date
2022-05-06
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In existing technologies, when multiple data items need to be uploaded to the blockchain, they need to be sorted and processed sequentially, resulting in low efficiency in uploading data to the blockchain.

Method used

By receiving data to be uploaded to the blockchain, selecting data smaller than a preset number as target data, and simultaneously requesting storage on the blockchain platform, the data is removed from the target data pool, thus enabling parallel on-chain processing of multiple data entries.

Benefits of technology

It improves the efficiency of data on-chain processing, enabling the simultaneous processing of multiple data entries without waiting for the on-chain result of the previous data entry, thus increasing processing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114896338B_ABST
    Figure CN114896338B_ABST
Patent Text Reader

Abstract

This application discloses a method, system, device, and computer-readable storage medium for data uploading to the blockchain. The method includes: receiving data to be uploaded to the blockchain; if the number of target data is less than a first preset number, selecting several data items to be uploaded as target data and placing them into a target data pool; requesting the blockchain platform to upload the target data for storage, and removing the target data to be uploaded from the target data pool. Unlike existing technologies that can only upload one piece of data at a time and require waiting for the previous data to be uploaded before the next data item can be uploaded, this application can upload multiple pieces of data simultaneously without waiting for the upload results of previous data, thus improving the efficiency of data uploading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a method, system, device and computer-readable storage medium for uploading data to the blockchain. Background Technology

[0002] Blockchain technology is a technology in which distributed nodes jointly participate in record-keeping and maintain a complete distributed database, and the consensus mechanism can ensure the consistency of transaction information stored on the blockchain. Data stored in the blockchain has characteristics such as "unforgeable," "fully traceable," "traceable," "open and transparent," and "collectively maintained." As a result, the use of blockchain technology for data storage has become common, and storing data on the blockchain can also be called data on-chain.

[0003] During the long-term research and development process, the applicant of this application discovered that, in general, when there are multiple pieces of data that need to be uploaded to the blockchain in the existing technology, the multiple pieces of data need to be sorted, and only one piece of data can be uploaded to the blockchain at a time. Only after the previous piece of data has been uploaded to the blockchain can the next piece of data be uploaded to the blockchain, resulting in low efficiency in data uploading. Summary of the Invention

[0004] The main technical problem addressed by this application is to provide a data uploading method, system, device, and computer-readable storage medium that can improve the efficiency of data uploading.

[0005] To address the aforementioned technical problems, this application adopts the following technical solution: providing a data uploading method, which includes: receiving data to be uploaded to the blockchain; if the number of target data is detected to be less than a first preset number, selecting several data items to be uploaded to the blockchain as target data and placing them into a target data pool; requesting the blockchain platform to upload and store the target data on the blockchain, and removing the target data to be uploaded and stored from the target data pool.

[0006] The process of receiving data to be uploaded to the blockchain includes: the blockchain service module receiving data to be uploaded to the blockchain.

[0007] If the number of target data detected is less than the first preset number, then selecting several pieces of data to be uploaded to the blockchain as target data includes: if the blockchain module detects that the number of target data is less than the first preset number, then subscribing to several pieces of data to be uploaded to the blockchain service module as target data; the blockchain module receiving the data to be uploaded to the blockchain sent by the blockchain service module as target data and putting it into the target data pool.

[0008] The method further includes: the on-chain module sending the task identifier to the on-chain service module, wherein the task identifier is generated by the blockchain platform for the target data.

[0009] The method further includes: selecting first data to be queried, wherein the first data to be queried is the data for which a request to be stored on the blockchain is made; querying the blockchain platform for the status of the on-chain task of the first data to be queried, wherein the status of the on-chain task includes successful on-chain and failed on-chain.

[0010] The selection of the first data to be queried includes: if the first query module detects that the number of the first data to be queried is less than the second preset number, it subscribes to the on-chain service module to request the data to be stored on the chain as the first data to be queried; the first query module receives the data sent by the on-chain service module as the first data to be queried.

[0011] The task of querying the blockchain platform for the first data to be queried includes: the first query module queries the blockchain platform for the task of querying the first data to be queried based on the task identifier, wherein the task identifier is generated by the blockchain platform for the target data.

[0012] The method also includes: the first query module sending the on-chain task information to the on-chain service module.

[0013] The method further includes: selecting a second set of data to be queried, wherein the second set of data to be queried is data whose on-chain task status is successful; querying the blockchain platform for the on-chain result of the second set of data to be queried, the on-chain result including on-chain completion and on-chain failure.

[0014] The selection of the second query data includes: if the second query module detects that the number of the second query data is less than the third preset number, it subscribes to the on-chain service module for data whose on-chain task status is successful, and uses it as the second query data; the second query module receives the data sent by the on-chain service module as the second query data.

[0015] The method also includes: the second query module sending the on-chain result to the on-chain service module.

[0016] The method further includes: receiving a data acquisition request, wherein the data acquisition request includes a data identifier of the data to be acquired; querying the on-chain result of the data to be acquired based on the data identifier; if the on-chain result is that the on-chain is completed, then acquiring the data to be acquired from the blockchain platform and receiving the acquisition result sent by the blockchain platform, wherein the acquisition result includes a prompt message indicating that there is no permission to acquire or the data to be acquired.

[0017] The method further includes, after receiving the data to be uploaded to the blockchain, saving the data and then uploading it to the blockchain after the blockchain platform experiences an anomaly and recovers.

[0018] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a data on-chain system, which includes an on-chain service module and an on-chain module. The on-chain service module is used to receive data to be on-chain, and the on-chain module is used to select several data to be on-chain as target data and put them into a target data pool if the number of target data detected is less than a first preset number, and to request the blockchain platform to store the target data on-chain, and to remove the target data to be stored on-chain from the target data pool.

[0019] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a data uploading device, which includes a processor and a memory. The memory is used to store program data, and the processor is used to execute the program data to implement any of the above-mentioned data uploading methods.

[0020] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium for storing program data, which can be executed to implement any of the above-mentioned data uploading methods.

[0021] In the above scheme, several data items are selected as target data from the data that needs to be stored on the blockchain and placed into a target data pool. At the same time, a request is made to the blockchain platform to store the target data on the blockchain, and the target data to be stored on the blockchain is removed from the target data pool. Unlike existing technologies that can only store one piece of data on the blockchain at a time and need to wait for the previous data to be stored on the blockchain before the next data can be stored on the blockchain, this scheme can store multiple pieces of data on the blockchain at the same time and can store subsequent data on the blockchain without waiting for the results of the previous data, thus improving the efficiency of data storage on the blockchain. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating an embodiment of the data uploading method of this application;

[0023] Figure 2 This is a schematic diagram of an embodiment of the data on-chain system of this application;

[0024] Figure 3 This is a flowchart illustrating another embodiment of the data uploading method of this application;

[0025] Figure 4 This is a flowchart illustrating another embodiment of the data uploading method of this application;

[0026] Figure 5 This is a flowchart illustrating yet another embodiment of the data uploading method of this application;

[0027] Figure 6 This is a flowchart illustrating yet another embodiment of the data uploading method of this application;

[0028] Figure 7 This is a schematic diagram of another embodiment of the data on-chain system of this application;

[0029] Figure 8 This is a schematic diagram of the framework of an embodiment of the data uplink device of this application;

[0030] Figure 9 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. Detailed Implementation

[0031] To make the purpose, technical solution and effects of this application clearer and more explicit, the following describes this application in further detail with reference to the accompanying drawings and embodiments.

[0032] In this article, the term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "more" in this article means two or more objects.

[0033] It is understood that the methods of this application may include the methods provided by any of the following method embodiments and any combination of the following method embodiments that do not conflict.

[0034] It is understood that the data uploading method in this application can be executed by a data uploading device, which can also be simply referred to as a device. The data uploading device can be any device with processing capabilities, such as a mobile phone, tablet computer, computer, etc.

[0035] Typically, during the execution of certain business processes, business data is generated in the corresponding business systems. To ensure that this business data cannot be tampered with, it can be stored in a blockchain. This application provides a data uploading method for storing business data in a blockchain. This method is executed by a data uploading device, which can interact with the device running the business system. The data uploading device runs a data uploading system. Through the interaction between the two devices, the business system can push the business data that needs to be stored on the blockchain to the data uploading system, enabling the data uploading system to upload the business data to the blockchain.

[0036] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the data uploading method of this application, the method including:

[0037] Step S110: Receive the data to be uploaded to the blockchain.

[0038] Generally, after business data is generated in a business system, one or more pieces of business data are packaged into a single data entry. This single data entry is then designated as "data to be uploaded to the blockchain," automatically triggering the blockchain upload process. The blockchain upload system receives this data, which is the data to be uploaded to the blockchain. The business data involved can include structured and unstructured data. Furthermore, the business system can package one or more pieces of business data into a single data entry; the specific number can be set by the business system. For example, a single data entry to be uploaded to the blockchain may include one or more pieces of business data, such as the claimant's name, department, expense item name, expense date, expense name, and reimbursement amount. The execution of step S110 is triggered by the business system uploading the data to the blockchain, and step S110 may be executed multiple times. When the business system pushes the data to be uploaded to the blockchain, the blockchain upload system receives the data.

[0039] Step S120: Determine whether the number of target data is less than the first preset number.

[0040] It should be noted that the data currently being requested for on-chain storage by the data on-chain system is called target data (including data about to be requested for on-chain storage and data currently being requested for on-chain storage). Specifically, the target data pool is used to hold target data. The data on-chain system requests on-chain storage (on-chain processing) of target data in the target data pool. The quantity of target data can be determined by the number of data in the target data pool, and whether it is less than a first preset quantity. The data on-chain system can process multiple pieces of target data on-chain simultaneously. The maximum number of target data to be processed on-chain simultaneously is the first preset quantity. Therefore, the quantity of target data is less than or equal to the first preset quantity. If the quantity of target data is detected to be less than the first preset quantity, the current quantity of target data in the target data pool can be zero or non-zero. This means that the data on-chain system has not yet reached its capacity limit for on-chain processing. In this case, data can be selected from the received data to be on-chain as target data for on-chain processing.

[0041] If the result of the judgment in step S120 is yes, then step S130 is executed.

[0042] Step S130: Select several pieces of data to be uploaded to the blockchain as target data and put them into the target data pool.

[0043] It should be noted that the data currently being processed on the blockchain by the data on-chain system is called the target data. Since the maximum number of data that the data on-chain system can process on the blockchain at the same time is the first preset number, the number of data to be on-chain selected in step S130 needs to be less than or equal to the difference between the first preset number and the current number of target data. Therefore, after executing step S130, the number of target data is still less than or equal to the first preset number.

[0044] Step S140: Request the blockchain platform to store the target data on the blockchain and remove the target data to be stored on the blockchain from the target data pool.

[0045] The blockchain platform may include several blockchain nodes. The data uploading device in this application can interact with the blockchain platform, that is, interact with several blockchain nodes, to store data on the blockchain.

[0046] It should be noted that the target data includes several data entries. Step S140 may involve simultaneously requesting the blockchain platform to store multiple data entries separately on the target data. If, before step S130, a portion of the target data already exists in the data-on-chain system, and the system has not yet processed the existing target data for on-chain storage, then in step S140, after selecting the data to be on-chain and placing it into the target data pool, the system can process all the data in the target data pool for on-chain storage together, that is, requesting the blockchain platform to store each data entry separately. If, before step S130, a portion of the target data already exists in the data-on-chain system, and some or all of the existing target data is being processed for on-chain storage, then in step S140, after selecting the data to be on-chain and placing it into the target data pool, the system can process all the data in the target data pool that has not yet been processed for on-chain storage together, or select a portion that has not yet been processed for on-chain storage. If the target data does not exist in the data upload system before step S130, then in step S140, the target data selected in step S130 can be uploaded to the blockchain together, or a portion of it can be uploaded to the blockchain.

[0047] After a request is made to store a target data item on the blockchain, that target data item is removed from the target data pool, and at this point, it is no longer considered target data.

[0048] Typically, existing methods of uploading data to the blockchain involve a business system triggering the uploading of business data, requesting the blockchain platform to store the business data. Generally, only one piece of business data can be uploaded to the blockchain at a time. If multiple pieces of business data need to be uploaded, they must be processed sequentially. Furthermore, for each piece of business data to be uploaded, the uploading operation must be performed, and the result of this operation must be confirmed before the uploading of that piece of business data is complete, and only then can the next piece of business data be uploaded. This results in low efficiency for data uploading to the blockchain.

[0049] It is understandable that triggering a data upload to the blockchain by a business system is different from requesting the blockchain platform to upload target data to the blockchain. The business system simply sends the data to be uploaded to the blockchain to request the data upload system to upload the data to the blockchain (including requesting the blockchain platform to upload the target data to the blockchain and querying the results of the upload operation). In this application, requesting the blockchain platform to upload the target data to the blockchain means performing the upload operation on the target data, but does not include querying the results of the upload operation. Furthermore, requesting the blockchain platform to upload the target data to the blockchain does not necessarily mean that the target data is stored in the blockchain, and it may not be stored in the blockchain.

[0050] In the above scheme, by receiving data to be uploaded to the blockchain, when the number of target data is less than a first preset number, several data to be uploaded to the blockchain are selected as target data, and a request is made to the blockchain platform to upload the target data to the blockchain. This allows multiple data to be uploaded to the blockchain at the same time, and subsequent data can be uploaded to the blockchain without waiting for the results of the previous data, thus improving the efficiency of data uploading to the blockchain.

[0051] Please see Figure 2 , Figure 2 This is a schematic diagram of an embodiment of the data uploading system of this application. The data uploading system 20 includes an uploading service module 21 and an uploading module 22. The data uploading device operates the data uploading system 20 to upload data, which is achieved through different modules of the data uploading system 20.

[0052] Please refer to the following: Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the data uploading method of this application, the method including:

[0053] Step S310: The on-chain service module receives the data to be uploaded to the chain.

[0054] It is understandable that after the business system generates business data, it will package one or more pieces of business data into a single data set and then use it as data to be uploaded to the blockchain, automatically triggering the data to be uploaded to the blockchain. In some embodiments, the business system can also number the packaged data that needs to be uploaded to the blockchain according to a preset numbering rule. The preset numbering rule can be determined by the user. For example, the preset numbering rule can be numbering sequentially according to time order, etc., and then the numbered data to be uploaded to the blockchain will be pushed to the data uploading system.

[0055] The description of step S310 can be found in the aforementioned content regarding step S110. The blockchain service module in the data blockchain system can receive the data to be blockchained pushed by the business system, along with the data's identifier. In the data blockchain system, a single piece of data can include one or more pieces of business data. Each piece of data has a corresponding status, which reflects the data's processing progress. The data blockchain system can classify data based on its status and update the status according to the processing progress. The categories of data status can be set according to user needs. For example, data status can include six categories: pending blockchain, blockchain in progress, blockchain failed, blockchain successful, blockchain completed, and blockchain abandoned. The initial status of the received data to be blockchained can be "pending blockchain."

[0056] It should be noted that the data upload system can also receive data to be uploaded to the blockchain from multiple business systems, and process the data to be uploaded to the blockchain from each business system separately. This application takes the processing of data to be uploaded to the blockchain from one business system as an example for illustration.

[0057] In some embodiments, the data upload system can save the data to be uploaded to the blockchain after receiving it. If the blockchain platform experiences an anomaly such as a power outage, restart, or network failure, the blockchain platform will suspend the upload process. After the anomaly is resolved, the data to be uploaded that the business system has already triggered but has not yet successfully uploaded needs to be re-uploaded. In this case, the data upload system can retrieve the corresponding data to be uploaded from the saved data and upload it again, without requiring the business system to repackage its business data as data to be uploaded or trigger the upload process. If the blockchain platform experiences an anomaly such as a blockchain system upgrade, all data stored on the blockchain may be lost. After the anomaly is resolved, all data to be uploaded to the blockchain needs to be re-uploaded. In this case, the data upload system can re-upload the saved data to the blockchain, thus preventing the loss of the data stored on the blockchain. Furthermore, the above operations can be performed by the upload service module.

[0058] It is understandable that a blockchain platform comprises several blockchain nodes. If one or more blockchain nodes are in an abnormal state, then the blockchain platform is considered to be abnormal. Furthermore, the data to be uploaded to the blockchain received by the data upload system can be permanently stored in the upload service module. Considering storage pressure, the upload service module can also periodically delete historical data to be uploaded to the blockchain according to user needs.

[0059] Specifically, the data upload system can store received data to be uploaded to the blockchain according to a preset storage strategy, using an upload service module and / or a third-party service module. For example, the data can be categorized according to its reception time or status, resulting in a first category and a second category. The upload service module stores the first category, and the third-party service module stores the second category. In one specific embodiment, data received within a preset time can be classified as the first category, and data received after the preset time as the second category; alternatively, data with a status indicating unsuccessful upload can be classified as the first category, and data with a status indicating successful upload as the second category. This allows the system to retrieve data received earlier / later, or data with a status indicating unsuccessful upload, from the upload service module and / or the third-party service module based on anomalies in the blockchain platform, making it easier to obtain data that needs to be re-uploaded due to anomalies.

[0060] Alternatively, considering storage pressure, the data upload system can use a third-party service module to store the data to be uploaded to the blockchain, while the corresponding data identifier is stored in the blockchain service module, allowing the data to be uploaded to the blockchain to be found based on the data identifier; or, the data upload system can use a separate blockchain service module to store the data to be uploaded to the blockchain.

[0061] In some embodiments, the data on-chain system may store the state and the data to be on-chain together using the on-chain service module and / or a third-party service module, and update the state according to the data processing status.

[0062] Step S320: The on-chain module determines whether the number of target data is less than the first preset number.

[0063] The description of step S320 can be found in the previous content about step S120. If the judgment result in step S320 is yes, then step S330 is executed.

[0064] Step S330: The on-chain module subscribes to several pieces of data to be on-chain from the on-chain service module as target data.

[0065] When the number of target data is less than the first preset number, the number of target data processed by the on-chain module has not yet reached the upper limit. In this case, data can be selected from the data to be uploaded to the chain as target data and put into the target data pool for on-chain processing, thereby giving full play to the role of the on-chain module.

[0066] Step S340: The on-chain service module sends the data to be uploaded to the on-chain module.

[0067] The on-chain service module distributes the corresponding data to be uploaded to the blockchain based on the subscription content of the on-chain module. Step S350: The on-chain module receives the data to be uploaded to the blockchain sent by the on-chain service module as the target data and puts it into the target data pool.

[0068] Step S130 can be implemented through steps S330-S350. Based on the subscription and distribution method, the on-chain module subscribes to data from the on-chain service module. The on-chain service module can distribute data based on the subscription content of the on-chain module. Thus, the on-chain module can obtain the data to be on-chain as target data. Each target data can include one or more business data. The on-chain module can process multiple target data on-chain at the same time.

[0069] Step S360: The on-chain module requests the blockchain platform to store the target data on the chain and removes the target data to be stored on the chain from the target data pool.

[0070] The on-chain module generates a separate on-chain request for each piece of target data, and then sends the data on-chain request to the blockchain platform to request the target data to be stored on the blockchain. Specifically, an on-chain request for a piece of target data can include the target data and its number.

[0071] It should be noted that, generally speaking, the process of putting a piece of data on the blockchain can be divided into two stages: the first stage is to request the blockchain platform to put the data on the blockchain, and the second stage is to confirm the status of the data being on the blockchain.

[0072] Step S360 corresponds to the first stage described above. In some embodiments, after the on-chain module requests the blockchain platform to store the target data on the chain, the blockchain platform generates an on-chain task identifier for each piece of target data and returns the task identifier to the on-chain module. The task identifier corresponds one-to-one with the target data to be on-chain. The on-chain module can also receive the task identifier returned by the blockchain platform and send it to the on-chain service module. Specifically, the task identifier can be an on-chain task ID. The blockchain platform can generate an on-chain task ID for each piece of target data. The on-chain module can also receive the on-chain task ID returned by the blockchain platform and send it to the on-chain service module.

[0073] In some embodiments, the data on-chain system can update the status of the corresponding target data to "on-chain" based on the task identifier returned by the blockchain platform. Furthermore, the on-chain module and / or the data on-chain module can perform the above-mentioned update steps.

[0074] It should be noted that the target data is the data that the on-chain module of the data on-chain system is currently processing on the chain. After the on-chain processing (requesting on-chain storage) is completed, the target data is removed from the target data pool and will no longer be used as target data. The status is then updated to "on-chain in progress", and the on-chain processing ends.

[0075] Please refer to the following: Figure 4 , Figure 4 This is a flowchart illustrating another embodiment of the data uploading method of this application. The second stage of the data uploading process is to determine the data uploading status, which may further include determining the uploading task status. The steps of the aforementioned embodiments may be executed sequentially or simultaneously with the steps of this embodiment. The method includes:

[0076] Step S410: Select the first data to be queried.

[0077] Wherein, the first data to be queried is the data currently being processed by the data on-chain system for the first query. The first data to be queried is the data for which a request to be stored on the chain has been made. The purpose of querying it is to determine its on-chain task status. In some embodiments, the status of the data for which a request to be stored on the chain is "on-chain". Then step S410 can be to select the first data to be queried from the data with the status "on-chain".

[0078] Step S420: Query the blockchain platform for the status of the on-chain task of the first data to be queried.

[0079] The on-chain task status includes successful and failed on-chain uploads. More specifically, the first data to be queried is the data requested for on-chain storage, which corresponds to a task identifier generated by the blockchain platform, such as an on-chain task ID. Step S420 can be implemented based on the task ID. Therefore, step S420 can query the blockchain platform for the on-chain task status corresponding to the task identifier of the first data to be queried, where the on-chain task status includes successful and failed on-chain uploads. It can be understood that the first data to be queried may include several data entries, and each data entry is queried separately to obtain the corresponding on-chain task status. Furthermore, the data on-chain system can simultaneously perform first query processing on multiple first data entries.

[0080] Based on this, in order to determine the status of data being uploaded to the blockchain, the data upload system 20 may also include a first query module 23, which is used to determine the status of the upload task.

[0081] In some embodiments, step S410 can also be implemented based on a subscription and distribution method. Similar to the on-chain module, the first query module processes a maximum number of data simultaneously, which is a second preset number. The first query module can then determine if the number of the first data to be queried is less than the second preset number. If the determination is yes, the first query module can subscribe to the on-chain service module to request data to be stored on-chain as the first data to be queried. The first data to be queried can also correspond to a first data pool. The number of data in the first data pool is the number of the first data to be queried. Similar to the on-chain module, the number of data subscribed by the first query module is less than or equal to the difference between the current number of the first data to be queried and the second preset number. Therefore, the number of the first data to be queried will not exceed the second preset number. The on-chain service module distributes data based on the subscription content of the first query module, sending data and / or data identifiers to the first query module. The first query module receives the data / data identifiers sent by the on-chain service module to determine the first data to be queried. The first query module queries the blockchain platform for the on-chain task status of the first data to be queried and receives the on-chain task status of the first data to be queried returned by the blockchain platform.

[0082] In some embodiments, the data on-chain system can also update the status of the data based on the on-chain task status. This step can be implemented by the first query module and / or the on-chain service module. Specifically, the first query module can also send the on-chain task status returned by the blockchain platform to the on-chain service module. The first query module and / or the on-chain service module can update the status of data with the on-chain task status of successful on-chain to successful on-chain, and update the status of data with the on-chain task status of failed on-chain to failed on-chain.

[0083] After the above steps are completed, the data on-chain system finishes processing the first query of the first data to be queried. The first data to be queried that has completed the processing can then be removed from the first data pool and will no longer be considered as the first data to be queried.

[0084] It should be noted that the two stages of the data uploading process have a certain sequential restriction. For example, only after requesting the blockchain platform to upload the data will the data have an uploading task, and only then can its uploading task status be queried. However, in a data uploading system, the uploading module is used to request the blockchain platform to upload the data, and the first query module is used to determine the data uploading status. The uploading module and the first query module are independent of each other and can work simultaneously, processing different data at the same time. Furthermore, the uploading module does not need to rely on the uploading task status of previous target data for processing subsequent target data. Specifically, once the uploading module has completed processing the current target data, it does not need to wait for the first query module to query the uploading status of the current target data as the first data to be queried. It can directly select the data to be uploaded as the new target data for processing. The data uploading method provided in this application can process multiple target data simultaneously and can process the next data without waiting for the uploading task status query, thus improving the efficiency of data uploading.

[0085] Please refer to the following: Figure 5 , Figure 5 This is a flowchart illustrating another embodiment of the data uploading method of this application. It should be noted that determining the uploading task status only confirms whether the uploading task was successfully executed once. Successful execution of the uploading task does not guarantee that the data is ultimately stored in the blockchain. In some cases, even if the uploading task status indicates success, the data may not be ultimately stored in the blockchain. For data uploading, the result depends on whether the data exists in the blockchain. Therefore, the second stage of the data uploading process is determining the data uploading status. Further, in addition to determining the uploading task status, it may also include determining the uploading result. The steps of the aforementioned embodiments and the steps of this embodiment can be executed sequentially or simultaneously. The method further includes:

[0086] Step S510: Select the second data to be queried.

[0087] It should be noted that the steps related to determining the on-chain result are optional and are set up to improve the accuracy of determining the data on-chain status. Not performing these steps will not affect the data on-chain. Furthermore, determining the on-chain result is performed based on determining the on-chain task status, further determining whether data with a successful on-chain task status is stored in the blockchain.

[0088] The second data to be queried is the data currently being processed by the data on-chain system for the second query. The second data to be queried is the data whose on-chain task status is successful. Specifically, data can be selected from the data whose on-chain task status is successful as the second data to be queried.

[0089] Step S520: Query the blockchain platform for the on-chain result of the second data to be queried.

[0090] Step S520 involves querying the blockchain platform to determine if the second queried data exists. The blockchain platform returns a corresponding on-chain result based on the existence of the second queried data. The on-chain result indicates whether the data is stored in the blockchain, and the format of the on-chain result can be set by the user. It is understood that the second queried data may include several data entries. Each data entry is queried separately to obtain the corresponding on-chain result. The data on-chain system can simultaneously process multiple second queried data entries, with a maximum simultaneous processing number of a third preset quantity. The on-chain result can include on-chain completion and on-chain failure. In a specific implementation scenario, the second query module can query the blockchain platform for the on-chain result based on the data identifier of the second queried data. The blockchain platform checks whether the second queried data exists on the chain based on the data identifier. If it exists, it returns "on-chain completion"; otherwise, it returns "on-chain failure." The data identifier is used to uniquely identify the data, such as a primary key. Alternatively, the on-chain result can only include "on-chain completion." The blockchain platform returns "on-chain completion" for second queried data that exists on the chain, and does not return a result for data that does not exist. Therefore, if the data upload system does not receive a completed upload result within a first preset time, it can consider the upload as a failure. The first preset time can be set by the user according to their needs.

[0091] Based on this, in order to determine the on-chain result, the data on-chain system 20 may also include a second query module 24 for determining the on-chain result.

[0092] In some embodiments, step S510 can also be implemented based on a subscription and distribution method. Similar to the first query module and the on-chain module, the second query module processes a maximum number of data simultaneously, which is a third preset number. The second query module can then determine whether the number of second query data is less than the third preset number. If the determination is yes, the second query module can subscribe to data from the on-chain service module whose on-chain task status is successful, using this data as the second query data. Correspondingly, the second query data can have a corresponding second query data pool, and the number of data in the second query data pool is the number of second query data. Similarly, the number of data subscribed by the second query module is less than or equal to the difference between the current number of second query data and the third preset number; therefore, the number of second query data will not exceed the third preset number. The on-chain service module distributes data based on the subscription content of the second query module, sending data and / or data identifiers to the second query module. The second query module receives the data and / or data identifiers sent by the on-chain service module to determine the second query data. The second query module then queries the blockchain platform for the on-chain result of the second query data.

[0093] After the above steps are completed, the data on-chain system finishes processing the second query for the second data to be queried. The second data to be queried that has completed the processing can then be removed from the second data pool and will no longer be considered as the second data to be queried.

[0094] It is understood that a single piece of data can be entered into the target data pool multiple times as target data for requesting on-chain storage, and can also be entered into the first query data pool / second query data pool multiple times as the first query data / second query data for the first / second query processing. The first, second, and third preset quantities can be adjusted by the user; they can be the same or different, and this application does not impose specific restrictions.

[0095] In some embodiments, the data on-chain system can also query and update the status of data based on the on-chain result. This step can be implemented by the second query module and / or the on-chain service module. Specifically, after receiving the on-chain result returned by the blockchain platform, the second query module can also send the on-chain result / the status updated based on the on-chain result to the on-chain service module. Then, both the second query module and the on-chain service module can update the status of the data based on the on-chain result. In a specific application scenario, the on-chain result includes on-chain completion and on-chain failure. The second query module can update the status of data with an on-chain completion result from "on-chain successful" to "on-chain completed," and update the status of data with an on-chain failure result from "on-chain successful" to "on-chain failure." In another specific application scenario, the on-chain result only includes "on-chain completion." In this case, the second query module can update the status of data with an on-chain completion result from "on-chain successful" to "on-chain completed."

[0096] For the on-chain service module, it can receive the on-chain result / status update based on the on-chain result sent by the second query module, and update the data status accordingly, similar to the process of the second query module updating the data status. In some embodiments, the on-chain service module can also update the status of data whose on-chain completion is to "on-chain" and then return a prompt message to the business system indicating that the data has been on-chain, to notify the business system that the data has been on-chain.

[0097] In a specific application scenario, the on-chain result only includes on-chain completion. In this case, the on-chain service module updates the status of data that has not received an on-chain result within a certain period of time from on-chain success to on-chain failure.

[0098] Similarly, in the process of putting data on the blockchain, the three parts—requesting the blockchain platform to put the data on the blockchain, determining the status of the on-chain task, and determining the on-chain result—have a specific order. For example, only after requesting the blockchain platform to put the data on the blockchain will there be a corresponding on-chain task for that data, and only then can the status of the on-chain task be queried. Only when the on-chain task status is successful can the on-chain result be further determined to ensure that the data has been put on the blockchain. However, in a data on-chain system, the on-chain module is used to request the blockchain platform to put the data on the blockchain, the first query module is used to determine the data on-chain status, and the second query module is used to determine the on-chain result. The on-chain module, the first query module, and the second query module are independent of each other and can work simultaneously, processing different data at the same time.

[0099] Similarly, the on-chain module does not depend on the on-chain task status and on-chain results obtained by the first and second query modules, nor does the first query module depend on the on-chain results obtained by the second query module. Specifically, the first query module processes the current first data to be queried to obtain the on-chain task status of the current first data to be queried. It does not need to wait for the second query module to query the on-chain results of the current first data to be queried and can directly select the data as the new first data to be queried for processing. The on-chain module, the first query module, and the second query module are all continuously processing the data in their respective data pools, removing the processed data, and selecting new data to put into the data pool. Compared to existing technologies, where on-chaining of a piece of business data is only completed after the on-chain task status and on-chain results are determined in sequence, and only then can the next piece of business data be processed, the data on-chaining method provided in this application can process multiple target data simultaneously, and can process the next piece of data without waiting for the on-chain task status and on-chain results, thus improving the efficiency of data on-chaining.

[0100] Besides the initial state of "awaiting to be added to the blockchain" received by the data on-chain system, which can be used as target data for on-chaining, in some embodiments, data whose state changes from "on-chain" to "failed to be added" and data whose state changes from "successful to be added" to "failed to be added" can also be used as target data for on-chaining. Furthermore, when selecting target data, that is, when the on-chain service module distributes data, it can follow preset rules. For example, the status update times of the three types of data (data received from the business system with an initial state of "awaiting to be added," data whose state changes from "on-chain" to "failed to be added," and data whose state changes from "successful to be added" to "failed to be added") are distributed sequentially. In a specific implementation scenario, for received data to be added to the blockchain, the initial state is generated upon receipt, so the status update time is the time when the data to be added to the blockchain is received; for the other two types of data, the status update time is the time when the state changes to "failed to be added," and data with earlier status update times are distributed first.

[0101] Similarly, when selecting the first and second pieces of data to be queried, the on-chain service module can distribute the data according to preset rules, such as distributing them sequentially according to the data's state update time. In a specific implementation scenario, for the first piece of data to be queried, the state update time is the time when the state transitions to being on the blockchain; for the second piece of data to be queried, the state update time is the time when the state successfully transitions to being on the blockchain.

[0102] In some embodiments, the data uploading system can also record the number of times data uploading fails. When the status changes to "upload failed," the failure count is incremented by one. An upper limit can also be set for the number of uploading attempts, for example, a fourth preset number. When the number of uploading failures is less than the fourth preset number, each time the status changes to "upload failed," it is treated as data to be uploaded to the blockchain, thus becoming target data for re-uploading. When the number of uploading failures reaches the fourth preset number, the data is no longer treated as data to be uploaded to the blockchain, and the status of the data is updated to "abandoned uploading." A message indicating that the data has abandoned uploading is returned to the business system to notify it that the data has been abandoned due to multiple uploading failures. Alternatively, no upper limit can be set for the number of uploading attempts. In this case, the data will be continuously re-uploaded after each failure until successful uploading. That is, each time the status changes to "upload failed," it is treated as data to be uploaded to the blockchain, waiting to be used as target data for re-uploading. The above steps can be implemented through the on-chain service module. The on-chain service module can update the data status based on the on-chain task status sent by the first query module and the second query module, thereby accurately recording the status of data on-chain each time.

[0103] In some embodiments, if the on-chain service module does not receive any on-chain task status / on-chain results within a second preset time period, the on-chain service module can initiate an on-chain task status query request / on-chain result query request for the data to the first query module / second query module, or directly query the blockchain platform for the on-chain task status / on-chain results of the data. This avoids inaccurate data on-chain status due to information loss during transmission and allows for a better grasp of the data on-chain status. The second preset time period can be set by the user according to their needs.

[0104] In the above scheme, by receiving data to be uploaded to the blockchain, when the number of target data is less than a first preset number, several data items to be uploaded to the blockchain are selected as target data, and a request is made to the blockchain platform to upload the target data to the blockchain. This allows multiple data items to be uploaded to the blockchain simultaneously, and subsequent data can be uploaded to the blockchain without waiting for the upload results of previous data, which improves the efficiency of data upload to the blockchain. Furthermore, the data upload task status and upload results can be queried separately, which can accurately grasp the data upload status.

[0105] Please see Figure 6 , Figure 6 This is a flowchart illustrating another embodiment of the data uploading method of this application. The method includes:

[0106] Step S610: Receive data acquisition request.

[0107] Understandably, the terminal device is a user-operated device that runs a client application. This terminal device can communicate with the data uploading device to obtain information about the uploading status of data (packaged with one or more business data items) and to retrieve data from the blockchain. Users can then use this client to view the uploading status of data and retrieve data from the blockchain. When the data uploading device's status changes, it can send corresponding change notifications to the terminal device, allowing users to view the data status and understand its uploading progress within the client. Furthermore, the terminal device can respond to user actions on the client by generating a data retrieval request and sending it to the data uploading device to obtain the data.

[0108] The data acquisition request includes the data identifier of the data to be acquired, which is used by the data on-chain system and the blockchain platform to determine the data to be acquired. The data identifier can be any data identifier that can uniquely identify the data, such as the data number, task ID, or primary key.

[0109] Understandably, terminal devices can send multiple data retrieval requests simultaneously, and the data upload system can process multiple data retrieval requests at the same time.

[0110] Step S620: Query the on-chain result of the data to be retrieved based on the data identifier.

[0111] Understandably, the process of acquiring the data to be acquired can be divided into two parts. First, the on-chain result of the data to be acquired is determined to determine whether it has been stored in the blockchain. If it has not been stored in the blockchain, there is no need to acquire the data from the blockchain platform. Instead, a message indicating that the data has not been uploaded to the blockchain is returned directly to the terminal device. If the data has been stored in the blockchain, then the data is acquired from the blockchain platform.

[0112] If the on-chain result is "on-chain complete," then it can be assumed that the data to be retrieved has been stored in the blockchain, and step S630 is executed. If the on-chain result is "on-chain complete," then it can be assumed that the data to be retrieved has not yet been stored in the blockchain, and a prompt message indicating that the data has not been uploaded to the blockchain is sent to the terminal device so that the user can confirm in the client that the data has not been uploaded to the blockchain.

[0113] To achieve data acquisition, the data on-chain system 20 may also include an acquisition service module 25, an on-chain verification module 26, and a data acquisition module 27. The acquisition service module 25 can be used to receive data acquisition requests sent by clients, the on-chain verification module 26 can be used to query the on-chain results of the data to be acquired, and the data acquisition module 27 can be used to acquire the data to be acquired from the blockchain platform.

[0114] Specifically, the acquisition service module receives a data acquisition request and sends the data identifier from the request to the on-chain verification module. The on-chain verification module can use the data identifier to query the second query module for the on-chain result of the data to be acquired. If the on-chain result is not complete, the on-chain verification module can send a message indicating that the data has not been uploaded to the blockchain to the acquisition service module, so that the acquisition service module can provide feedback to the client for the user to view. If the on-chain result is complete, the on-chain verification module can send a corresponding data acquisition request to the data acquisition module, so that the data acquisition module can retrieve the data to be acquired from the blockchain platform based on the data identifier.

[0115] Step S630: Obtain the data to be obtained from the blockchain platform and receive the acquisition result sent by the blockchain platform.

[0116] The retrieval results include either a message indicating insufficient access or the data to be retrieved. The blockchain platform returns the corresponding retrieval result to the data-on-chain system based on the data to be retrieved and the data access permissions of the user who sent the data retrieval request. Specifically, the blockchain platform determines whether the user sending the data retrieval request has the necessary permissions. If so, the blockchain platform sends the corresponding data to be retrieved to the data-on-chain system; otherwise, the blockchain platform sends a message indicating insufficient access permissions to the data-on-chain system. After receiving the retrieval result from the blockchain platform, the data-on-chain system can also send the result to the terminal device so that the user can view the result on the client side.

[0117] Furthermore, the data acquisition module receives the acquisition results returned by the blockchain platform and sends the acquisition results to the acquisition service module. The acquisition service module then sends the acquisition results to the terminal device so that the user can view the corresponding acquisition results in the client.

[0118] In the above scheme, by first determining whether the data to be acquired is on the blockchain, there is no need to retrieve it from the blockchain platform if it is not on the blockchain, and to retrieve the data from the blockchain platform if it is already on the blockchain. This allows for convenient data retrieval and the simultaneous retrieval of multiple data entries, thus improving the efficiency of data retrieval on the blockchain.

[0119] Please see Figure 7 , Figure 7 This is a schematic diagram of another embodiment of the data on-chain system of this application.

[0120] In this embodiment, the data on-chain system 70 includes an on-chain service module 71 and an on-chain module 72. The on-chain service module 71 can be used to receive data to be on-chain, and the on-chain module 72 can be used to select several data to be on-chain as target data and put them into the target data pool if the number of target data detected is less than a first preset number, and to request the blockchain platform to store the target data on-chain, and to remove the target data to be stored on-chain from the target data pool.

[0121] Please see Figure 8 , Figure 8 This is a schematic diagram of the framework of an embodiment of the data uplink device of this application.

[0122] In this embodiment, the data uplink device 80 includes a memory 81 and a processor 82, wherein the memory 81 is coupled to the processor 82. Specifically, the various components of the data uplink device 80 can be coupled together via a bus, or the processor 82 of the data uplink device 80 can be connected to each other individually. The data uplink device 80 can be any device with processing capabilities, such as a computer, tablet computer, or mobile phone.

[0123] The memory 81 is used to store program data executed by the processor 82, as well as data generated by the processor 82 during processing. For example, the status and data identifier of data to be uploaded to the blockchain. The memory 81 includes a non-volatile storage portion for storing the aforementioned program data.

[0124] Processor 82 controls the operation of data uplink device 80. Processor 82 can also be called CPU (Central Processing Unit). Processor 82 may be an integrated circuit chip with signal processing capabilities. Processor 82 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The general-purpose processor can be a microprocessor or any conventional processor. In addition, processor 82 can be implemented by multiple integrated circuit chips.

[0125] The processor 82 executes instructions to implement any of the above data uplink methods by calling the program data stored in the memory 81.

[0126] Please see Figure 9 , Figure 9 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application.

[0127] In this embodiment, the computer-readable storage medium 90 stores processor-executable program data 91, which can be executed to implement any of the above-described data uplink methods.

[0128] The computer-readable storage medium 90 can specifically be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or a medium that can store program data. Alternatively, it can be a server that stores the program data, which can send the stored program data to other devices for execution or can also execute the stored program data itself.

[0129] In some embodiments, the computer-readable storage medium 90 may also be such as Figure 8 The memory shown.

[0130] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for uploading data to the blockchain, characterized in that, The method is applied to a data on-chain system, which includes an on-chain service module, an on-chain module, a first query module, and a second query module. The on-chain module, the first query module, and the second query module are independent of each other. The on-chain service module receives data to be uploaded to the chain and stores a first type of data to be uploaded to the chain. The third-party service module stores a second type of data to be uploaded to the chain. The first type of data to be uploaded to the chain is data to be uploaded to the chain that was received within a preset time and the second type of data to be uploaded to the chain is data to be uploaded to the chain that was received within a preset time. Alternatively, the first type of data to be uploaded to the chain is data to be uploaded to the chain that is not in a state of successful on-chain and the second type of data to be uploaded to the chain is data to be uploaded to the chain that is in a state of successful on-chain. If the on-chain module detects that the number of target data is less than a first preset number, it subscribes to several pieces of data to be on-chain as the target data from the on-chain service module and puts them into the target data pool. The first preset number is the maximum number of data items that the data on-chain system can process simultaneously. The number of selected pieces of data to be on-chain is less than or equal to the difference between the first preset number and the current number of target data items. Simultaneously, it requests the blockchain platform to store each piece of data to be on-chain within the target data and removes the stored target data from the target data pool. When the blockchain platform experiences an anomaly and recovers, it retrieves the data to be on-chain from the on-chain service module and / or the third-party service module for on-chain processing. If the first query module detects that the number of the first data to be queried is less than the second preset number, it subscribes to the blockchain service module to request the data to be stored on the blockchain, receives the data sent by the blockchain service module as the first data to be queried, and queries the blockchain platform for the blockchain task status of the first data to be queried. The blockchain task status includes successful blockchain access and failed blockchain access. If the second query module detects that the number of second query data is less than the third preset number, it subscribes to the data whose on-chain task status is successful on the blockchain service module, receives the data sent by the on-chain service module as the second query data, and queries the blockchain platform for the on-chain result of the second query data. The on-chain result includes on-chain completion and on-chain failure.

2. The method according to claim 1, characterized in that, The method further includes: The on-chain module of the data on-chain system sends the task identifier to the on-chain service module of the data on-chain system, wherein the task identifier is generated by the blockchain platform for the target data.

3. The method according to claim 1, characterized in that, The on-chain task of querying the first data to be queried from the blockchain platform includes: The first query module queries the blockchain platform for the on-chain task status of the first data to be queried, based on the task identifier, wherein the task identifier is generated by the blockchain platform for the target data; and / or, The method further includes: The first query module sends the on-chain task information to the on-chain service module.

4. The method according to claim 1, characterized in that, The method further includes: The second query module sends the on-chain result to the on-chain service module.

5. The method according to claim 1, characterized in that, The method further includes: Receive a data acquisition request, wherein the data acquisition request includes a data identifier of the data to be acquired; Based on the data identifier, query the on-chain result of the data to be obtained; If the on-chain result is "on-chain complete", then the data to be acquired is obtained from the blockchain platform, and the acquisition result sent by the blockchain platform is received. The acquisition result includes a prompt message indicating that the data cannot be acquired or the data to be acquired.

6. A data on-chain system, characterized in that, The data on-chain system includes an on-chain service module, an on-chain module, a first query module, and a second query module, which are independent of each other. The on-chain service module receives data to be on-chain and stores a first type of data to be on-chain, while a third-party service module stores a second type of data to be on-chain. The first type of data to be on-chain consists of data received within a preset time, and the second type consists of data received beyond a preset time; alternatively, the first type consists of data whose status is not "on-chain successful," and the second type consists of data whose status is "on-chain successful." The on-chain module, if it detects that the number of target data is less than a first preset number, subscribes to several pieces of data to be on-chain as target data from the on-chain service module and places them in a target data pool. Simultaneously, it requests the blockchain platform to store each piece of data to be on-chain within the target data, and removes the stored target data from the target data pool. The first preset number is the number of data items to be on-chain. The maximum number of data items that the on-chain system can process simultaneously is determined by the following: the number of selected data items to be on-chain is less than or equal to the difference between the first preset number and the current number of target data items; when the blockchain platform experiences an anomaly and recovers, it retrieves the data to be on-chain from the on-chain service module and / or the third-party service module for on-chain processing; the first query module is used to subscribe to the data requesting on-chain storage from the on-chain service module if it detects that the number of the first data items to be queried is less than the second preset number, receive the data sent by the on-chain service module as the first data items to be queried, and query the blockchain platform for the on-chain task status of the first data items to be queried, including on-chain success and on-chain failure; the second query module is used to subscribe to the data with the on-chain task status of successful on-chain from the on-chain service module if it detects that the number of the second data items to be queried is less than the third preset number, receive the data sent by the on-chain service module as the second data items to be queried, and query the blockchain platform for the on-chain result of the second data items to be queried, including on-chain completion and on-chain failure.

7. A data uploading device, characterized in that, The device includes a processor and a memory, the memory being used to store program data, and the processor being used to execute the program data to implement the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program data that can be executed to implement the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Business processing method and device based on block chain, electronic equipment and storage medium

    CN110535661A

  • Blood data storage method and device, node server and storage medium

    CN112000973A

  • Blockchain data uplink verification method and device, equipment and storage medium

    CN112507024A

  • Data uplink method and device, electronic equipment and storage medium

    CN112866359A

  • Data processing method and device based on block chain, equipment and storage medium

    CN114116710A