业务数据回退方法、装置、计算机设备和存储介质Business data rollback method, device, computer equipment and storage medium
本申请要求于2019年05月22日提交中国专利局,申请号为2019104279045,申请名称为“业务数据回退方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on May 22, 2019. The application number is 2019104279045, and the application name is "Business data rollback method, device, computer equipment and storage medium". The reference is incorporated in this application.
技术领域Technical field
本申请涉及一种业务数据回退方法、装置、计算机设备和存储介质。This application relates to a business data rollback method, device, computer equipment and storage medium.
背景技术Background technique
随着数据处理技术的发展,出现了区块链技术,区块链的存储数据安全性,使得区块链技术被应用在各种业务数据的处理上。在业务数据的处理过程中,需要对数据进行操作,将操作数据存储到区块链。With the development of data processing technology, the emergence of blockchain technology, the security of the stored data of the blockchain, makes the blockchain technology be applied to the processing of various business data. In the processing of business data, it is necessary to manipulate the data and store the operating data in the blockchain.
然而,发明人意识到,在业务数据的处理过程中,区块链中的业务数据可以由该业务数据对应的多个业务方共享,并可以由该多个业务方借助于各自对应的终端(比如第一终端或第二终端)对区块链中的业务数据进行修改。对于涉及到多业务方的业务数据,需要保持多业务方访问的业务数据的一致性,传统的区块链存储数据,对一个业务方修改的业务数据存储,当另一个业务方不知情的情况下容易导致业务数据处理错误,从而造成对业务数据处理准确性较低。However, the inventor realized that during the processing of business data, the business data in the blockchain can be shared by multiple business parties corresponding to the business data, and the multiple business parties can use their respective terminals ( For example, the first terminal or the second terminal) modify the business data in the blockchain. For business data involving multiple business parties, it is necessary to maintain the consistency of the business data accessed by multiple business parties. The traditional blockchain stores data, and the business data modified by one business party is stored when the other business party does not know it. Downloading can easily lead to business data processing errors, resulting in lower accuracy of business data processing.
发明内容Summary of the invention
根据本申请公开的各种实施例,提供一种业务数据回退方法、装置、计算机设备和存储介质。According to various embodiments disclosed in the present application, a method, apparatus, computer equipment, and storage medium for business data rollback are provided.
一种业务数据回退方法包括:A business data rollback method includes:
接收第一终端发送的携带有业务数据标识的业务数据修改请求;Receiving a service data modification request carrying a service data identifier sent by the first terminal;
根据所述业务数据修改请求确定修改后的业务数据,将所述修改后的业务数据存储至区块链,并根据所述修改后的业务数据生成业务数据审核指令;Determine the modified business data according to the business data modification request, store the modified business data in a blockchain, and generate a business data review instruction according to the modified business data;
根据所述业务数据标识确定第二终端,将所述业务数据审核指令发送至所述第二终端,并接收所述第二终端针对所述业务数据审核指令反馈的审核意见数据;Determine a second terminal according to the business data identifier, send the business data review instruction to the second terminal, and receive review opinion data fed back by the second terminal in response to the business data review instruction;
将所述审核意见数据作为所述修改后的业务数据的审核状态,并与所述修改后的业务数据关联存储至所述区块链中;Use the review opinion data as the review status of the modified business data, and store it in the blockchain in association with the modified business data;
若接收到所述第一终端发送的携带有所述业务数据标识的业务数据查询请求,则根据所述业务数据查询请求从所述区块链中查找所述修改后的业务数据的审核状态;If a business data query request carrying the business data identifier sent by the first terminal is received, search for the review status of the modified business data from the blockchain according to the business data query request;
当查找到的所述审核状态为审核未通过时,根据所述业务数据标识从所述区块链中查找最新版本、且审核状态为审核通过的目标业务数据,并将所述目标业务数据反馈至所述 第一终端。When the found review status is the review failed, the latest version is searched from the blockchain according to the business data identifier and the review status is the target business data that has passed the review, and the target business data is fed back To the first terminal.
一种业务数据回退装置包括:A business data rollback device includes:
接收模块,用于接收第一终端发送的携带有业务数据标识的业务数据修改请求;A receiving module, configured to receive a service data modification request carrying a service data identifier sent by the first terminal;
存储模块,用于根据所述业务数据修改请求确定修改后的业务数据,将所述修改后的业务数据存储至区块链,并根据所述修改后的业务数据生成业务数据审核指令;The storage module is configured to determine the modified business data according to the business data modification request, store the modified business data on the blockchain, and generate a business data review instruction according to the modified business data;
审核模块,用于根据所述业务数据标识确定第二终端,将所述业务数据审核指令发送至所述第二终端,并接收所述第二终端针对所述业务数据审核指令反馈的审核意见数据;The review module is configured to determine a second terminal according to the business data identifier, send the business data review instruction to the second terminal, and receive review opinion data fed back by the second terminal in response to the business data review instruction ;
所述存储模块,还用于将所述审核意见数据作为所述修改后的业务数据的审核状态,并与所述修改后的业务数据关联存储至所述区块链中;The storage module is further configured to use the review opinion data as the review status of the modified business data, and store it in the blockchain in association with the modified business data;
查找模块,用于若接收到所述第一终端发送的携带有所述业务数据标识的业务数据查询请求,则根据所述业务数据查询请求从所述区块链中查找所述修改后的业务数据的审核状态;The search module is configured to, if a service data query request carrying the service data identifier sent by the first terminal is received, search for the modified service from the blockchain according to the service data query request Data review status;
反馈模块,用于当查找到的所述审核状态为审核未通过时,根据所述业务数据标识从所述区块链中查找最新版本、且审核状态为审核通过的目标业务数据,并将所述目标业务数据反馈至所述第一终端。The feedback module is used to find the latest version of the target business data from the blockchain according to the business data identifier and the review status is the target business data that has passed the review when the review status found is the review failed The target service data is fed back to the first terminal.
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器实现本申请任意一个实施例中提供的业务数据回退方法的步骤。A computer device includes a memory and one or more processors. The memory stores computer readable instructions. When the computer readable instructions are executed by the one or more processors, the one or more Each processor implements the steps of the service data rollback method provided in any embodiment of the present application.
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器实现本申请任意一个实施例中提供的业务数据回退方法的步骤。One or more non-volatile computer-readable storage media storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors implement any of the present application The steps of the business data rollback method provided in an embodiment.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。The details of one or more embodiments of the application are set forth in the following drawings and description. Other features and advantages of this application will become apparent from the description, drawings and claims.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1为根据一个或多个实施例中业务数据回退方法的应用场景图。Fig. 1 is an application scenario diagram of a business data rollback method according to one or more embodiments.
图2为根据一个或多个实施例中业务数据回退方法的流程示意图。Fig. 2 is a schematic flowchart of a business data rollback method according to one or more embodiments.
图3为另一个实施例中业务数据回退方法的流程示意图。Fig. 3 is a schematic flowchart of a business data rollback method in another embodiment.
图4为根据一个或多个实施例中业务数据回退装置的框图。Fig. 4 is a block diagram of a service data rollback device according to one or more embodiments.
图5为根据一个或多个实施例中计算机设备的框图。Figure 5 is a block diagram of a computer device according to one or more embodiments.
具体实施方式Detailed ways
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the technical solutions and advantages of the present application clearer, the following further describes the present application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the application, and not used to limit the application.
本申请提供的业务数据回退方法,可以应用于如图1所示的应用环境中。第一终端102和第二终端106分别通过网络与服务器104进行通信。服务器104接收第一终端102发送的携带有业务数据标识的业务数据修改请求,将根据业务数据修改请求确定的修改后的业务数据存储至区块链中,并根据修改后的业务数据触发生成发送至第二终端106的业务数据审核指令,进而在接收到第二终端106针对业务数据审核指令反馈的审核意见数据时,将该审核意见数据作为修改后的业务数据的审核状态,并与修改后的业务数据关联存储至区块链中。进一步地,服务器104在接收到第一终端发送的携带业务数据标识的业务数据查询请求时,从区块链中查找修改后的业务数据的审核状态,且当该审核状态为审核未通过时,根据业务数据标识从区块链中查找最新版本、且审核状态为审核通过的目标业务数据,并将该目标业务数据反馈至第一终端102。第一终端102和第二终端106可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。服务器104具体可以是区块链系统的分布式服务器。The business data rollback method provided in this application can be applied to the application environment shown in FIG. 1. The first terminal 102 and the second terminal 106 respectively communicate with the server 104 via the network. The server 104 receives the service data modification request carrying the service data identifier sent by the first terminal 102, stores the modified service data determined according to the service data modification request in the blockchain, and triggers generation and transmission according to the modified service data The business data review instruction to the second terminal 106, and then when the review review data fed back by the second terminal 106 for the business data review instruction is received, the review review data is regarded as the review status of the modified business data, and is compared with the review status of the modified business data. The business data is stored in the blockchain. Further, when the server 104 receives the business data query request carrying the business data identifier sent by the first terminal, it searches the blockchain for the review status of the modified business data, and when the review status is the review failed, According to the business data identifier, search for the target business data of the latest version from the blockchain and the review status is approved, and feed the target business data back to the first terminal 102. The first terminal 102 and the second terminal 106 can be, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server 104 can be an independent server or a server cluster composed of multiple servers. achieve. The server 104 may specifically be a distributed server of the blockchain system.
在其中一个实施例中,服务器104是区块链系统中的区块链节点所对应的服务器,具体可以是区块链节点本身。In one of the embodiments, the server 104 is a server corresponding to the blockchain node in the blockchain system, and specifically may be the blockchain node itself.
在其中一个实施例中,如图2所示,提供了一种业务数据回退方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:In one of the embodiments, as shown in FIG. 2, a business data rollback method is provided. Taking the method applied to the server in FIG. 1 as an example for description, the method includes the following steps:
S202,接收第一终端发送的携带有业务数据标识的业务数据修改请求。S202: Receive a service data modification request carrying a service data identifier sent by the first terminal.
业务数据标识用于唯一标识业务数据。业务数据具体可以是订单信息或订单数据。业务数据修改请求是用于触发业务数据修改操作的请求,用于指示服务器将修改后的业务数据存储至区块链中,以实现对目标业务数据的修改。业务数据修改请求中可携带有修改后的业务数据,也就是对目标业务数据进行修改得到的业务数据。The business data identifier is used to uniquely identify the business data. The business data may specifically be order information or order data. The business data modification request is a request used to trigger a business data modification operation, and is used to instruct the server to store the modified business data in the blockchain to modify the target business data. The business data modification request may carry modified business data, that is, business data obtained by modifying the target business data.
具体地,第一终端通过修改人操作界面将待修改的业务数据展示给修改人,并实时检测修改人针对展示的待修改的业务数据触发的预设数据提交操作。当检测到预设数据提交操作时,第一终端获取修改人针对目标业务数据预录入或预选取的业务数据,作为修改后的业务数据,将该修改后的业务数据确定为存储至区块链的修改后的业务数据。第一终端根据修改后的业务数据生成业务数据修改请求,并将生成的业务数据修改请求发送至服务器。Specifically, the first terminal displays the business data to be modified to the modifier through the modifier operation interface, and detects in real time a preset data submission operation triggered by the modifier on the displayed business data to be modified. When the preset data submission operation is detected, the first terminal obtains the business data pre-entered or pre-selected by the modifier for the target business data as the modified business data, and determines that the modified business data is stored in the blockchain The revised business data. The first terminal generates a service data modification request according to the modified service data, and sends the generated service data modification request to the server.
在其中一个实施例中,第一终端实时检测预设触发条件,当检测到预设触发条件时,根据检测到的预设触发条件触发生成携带有业务数据标识的业务数据查询请求,将生成的 业务数据查询请求发送至服务器,以借助于服务器从区块链中查询与业务数据标识对应的、且待修改的业务数据。In one of the embodiments, the first terminal detects a preset trigger condition in real time, and when the preset trigger condition is detected, it triggers generation of a service data query request carrying a service data identifier according to the detected preset trigger condition, and generates The business data query request is sent to the server to query the business data corresponding to the business data identifier and to be modified from the blockchain by means of the server.
S204,根据业务数据修改请求确定修改后的业务数据,将修改后的业务数据存储至区块链,并根据修改后的业务数据生成业务数据审核指令。S204: Determine the modified business data according to the business data modification request, store the modified business data in the blockchain, and generate a business data review instruction according to the modified business data.
业务数据审核指令是用于触发业务数据审核操作的指令,用于指示第二终端将待审核的修改后的业务数据展示给审核员,并获取审核员针对该修改后的业务数据触发的审核意见数据。The business data review instruction is an instruction used to trigger the business data review operation, which is used to instruct the second terminal to display the modified business data to be reviewed to the auditor, and obtain the review opinion triggered by the auditor on the modified business data data.
具体地,服务器解析业务数据修改请求得到修改后的业务数据,并对该修改后的业务数据执行入链操作,以将该修改后的业务数据存储至区块链中,从而实现对目标业务数据的修改。当将修改后的业务数据写入区块链时,服务器根据修改后的业务数据生成相应的业务数据审核指令。Specifically, the server parses the business data modification request to obtain the modified business data, and performs an in-chain operation on the modified business data, so as to store the modified business data in the blockchain, so as to realize the target business data Modifications. When the modified business data is written into the blockchain, the server generates corresponding business data review instructions according to the modified business data.
在其中一个实施例中,当成功将修改后的业务数据写入区块链时,服务器根据该修改后的业务数据生成业务数据审核指令。服务器可生成携带有修改后的业务数据的业务数据审核指令,也可生成携带有业务数据标识的业务数据审核指令。In one of the embodiments, when the modified business data is successfully written into the blockchain, the server generates a business data review instruction according to the modified business data. The server may generate a business data review instruction carrying modified business data, and may also generate a business data review instruction carrying a business data identifier.
S206,根据业务数据标识确定第二终端,将业务数据审核指令发送至第二终端,并接收第二终端针对业务数据审核指令反馈的审核意见数据。S206: Determine the second terminal according to the service data identifier, send the service data review instruction to the second terminal, and receive review opinion data fed back by the second terminal in response to the service data review instruction.
审核意见数据用于表征审核员对第二终端展示的修改后的业务数据的审核意见,具体可包括审核通过和审核未通过。根据审核意见数据可确定审核员是否同意修改人修改得到的修改后的业务数据。The review opinion data is used to characterize the review opinions of the auditor on the modified business data displayed on the second terminal, and may specifically include the review passed and the review failed. According to the audit opinion data, it can be determined whether the auditor agrees with the modifier to modify the modified business data.
具体地,服务器根据业务数据标识确定第二终端,并将生成的业务数据审核指令发送至所确定的第二终端。第二终端根据接收的业务数据审核指令确定待审核的修改后的业务数据,将该修改后的业务数据通过审核员操作界面展示给审核员,并实时检测审核员针对展示的修改后的业务数据触发的审核意见数据,进而将检测到的审核意见数据反馈至服务器。Specifically, the server determines the second terminal according to the service data identifier, and sends the generated service data review instruction to the determined second terminal. The second terminal determines the modified business data to be reviewed according to the received business data review instruction, displays the modified business data to the auditor through the auditor operation interface, and detects the revised business data displayed by the auditor in real time The triggered audit opinion data, and then the detected audit opinion data is fed back to the server.
在其中一个实施例中,根据业务数据标识确定第二终端,将业务数据审核指令发送至第二终端,包括:根据业务数据标识确定审核员账号;将业务数据审核指令发送至以审核员账号登录的第二终端;业务数据审核指令用于指示第二终端将修改后的业务数据进行展示,并获取修改后的业务数据对应的审核意见数据。In one of the embodiments, determining the second terminal according to the business data identifier and sending the business data review instruction to the second terminal includes: determining the auditor account based on the business data identifier; sending the business data review instruction to log in with the reviewer account The second terminal of the business data review instruction is used to instruct the second terminal to display the modified business data and obtain the review opinion data corresponding to the modified business data.
审核员账号是指审核员预先注册的、且用于登录第二终端的账号。审核员账号具体可以是借助于第二终端登录特定客户端、浏览器、网页或系统的账号。审核员账号可用于唯一标识审核员,具体可以是由数字、字母和符号等字符中的至少一种组成的字符串。The auditor account refers to an account pre-registered by the auditor and used to log in to the second terminal. The auditor account may specifically be an account used to log in to a specific client, browser, webpage, or system by means of the second terminal. The auditor account number can be used to uniquely identify the auditor, which can be a character string composed of at least one of numbers, letters, and symbols.
具体地,当生成业务数据审核指令时,服务器根据业务数据标识在数据库中查询预配置的审核员账号,并确定以该审核员账号登录的第二终端,进而将生成的业务数据审核指令发送至所确定的第二终端。第二终端根据接收到的业务数据审核指令确定待审核的修改后的业务数据,将该修改后的业务数据展示给审核员,并获取审核员针对展示的修改后的 业务数据触发的审核意见数据。Specifically, when generating the business data review instruction, the server queries the pre-configured auditor account in the database according to the business data identifier, and determines the second terminal to log in with the auditor account, and then sends the generated business data review instruction to The determined second terminal. The second terminal determines the modified business data to be reviewed according to the received business data review instruction, displays the modified business data to the auditor, and obtains the review opinion data triggered by the auditor on the displayed modified business data .
在其中一个实施例中,服务器根据业务数据标识在数据库中查询与该业务数据标识相匹配的审核员标识,并根据审核员标识查询预配置的审核员账号。In one of the embodiments, the server searches the database for an auditor ID matching the service data ID according to the service data ID, and searches the pre-configured auditor account according to the auditor ID.
在其中一个实施例中,当查询到与业务数据标识相匹配的审核员标识时,服务器根据审核员标识在数据库中查询预配置的第二终端标识,并将业务数据审核指令发送至第二终端标识对应的第二终端。In one of the embodiments, when an auditor ID matching the service data ID is queried, the server queries the database for the pre-configured second terminal ID according to the auditor ID, and sends the service data audit instruction to the second terminal Identify the corresponding second terminal.
在其中一个实施例中,第二终端解析接收到的业务数据审核指令得到待审核的修改后的业务数据,将该修改后的业务数据展示给审核员,获取审核员针对该修改后的业务数据触发的审核意见数据,并将该审核意见数据反馈至服务器。In one of the embodiments, the second terminal parses the received business data review instruction to obtain the modified business data to be reviewed, displays the modified business data to the auditor, and obtains the auditor’s modified business data Triggered review opinion data, and feedback the review opinion data to the server.
在其中一个实施例中,接收第二终端针对业务数据审核指令反馈的审核意见数据,包括:接收第二终端发送的与业务数据标识对应的审核数据查询请求;根据审核数据查询请求从区块链中查找业务数据标识对应的修改后的业务数据;将修改后的业务数据发送至第二终端进行展示,并接收第二终端针对修改后的业务数据反馈的审核意见数据。In one of the embodiments, receiving the review opinion data fed back by the second terminal for the business data review instruction includes: receiving the review data query request corresponding to the business data identifier sent by the second terminal; and downloading the review data from the blockchain according to the review data query request Find the modified service data corresponding to the service data identifier in the, send the modified service data to the second terminal for display, and receive the review opinion data fed back by the second terminal for the modified service data.
审核数据查询请求是用于触发审核数据查询操作的请求,用于指示服务器查询并反馈待审核的修改后的业务数据。The audit data query request is a request used to trigger the audit data query operation, and is used to instruct the server to query and feed back the revised business data to be audited.
具体地,服务器将生成的业务数据审核指令发送到根据业务数据标识确定第二终端。第二终端解析该业务数据审核指令得到业务数据标识,根据该业务数据标识生成审核数据查询请求,并将生成的审核数据查询请求发送至服务器。服务器根据接收到的审核数据查询请求确定业务数据标识,并根据业务数据标识在区块链中查找与该业务数据标识对应的修改后的业务数据,进而将查找到的修改后的业务数据发送至第二终端。第二终端将接收到的修改后的业务数据通过审核员操作界面展示给审核员,并检测审核员针对展示的该修改后的业务数据触发的审核意见数据,进而将检测到的审核意见数据反馈至服务器。Specifically, the server sends the generated service data review instruction to the second terminal determined according to the service data identifier. The second terminal parses the service data audit instruction to obtain a service data identifier, generates an audit data query request according to the service data identifier, and sends the generated audit data query request to the server. The server determines the business data identifier according to the received audit data query request, and finds the modified business data corresponding to the business data identifier in the blockchain according to the business data identifier, and then sends the found modified business data to The second terminal. The second terminal displays the received modified business data to the auditor through the auditor operation interface, and detects the audit opinion data triggered by the auditor on the displayed modified business data, and then feeds back the detected audit opinion data To the server.
在其中一个实施例中,服务器根据审核数据查询请求从区块链中查找业务数据标识对应的最新版本的业务数据,作为修改后的业务数据。服务器在区块链中查找业务数据标识对应的业务数据,并确定查找到的各业务数据的版本号(或入链时间),进而从查找到的业务数据中选取版本号最新(或入链时间最晚或最近)的业务数据,作为修改后的业务数据。In one of the embodiments, the server searches the blockchain for the latest version of the business data corresponding to the business data identifier according to the audit data query request, as the modified business data. The server searches for the business data corresponding to the business data identifier in the blockchain, and determines the version number (or entry time) of each business data found, and then selects the latest version number (or entry time) from the searched business data The latest or most recent business data is used as the modified business data.
在其中一个实施例中,服务器根据审核数据查询请求从区块链中查找与业务数据标识对应的、且审核状态为待审核(或未审核)的业务数据,作为修改后的业务数据。服务器在区块链中查找业务数据标识对应的业务数据,并从查找到的业务数据中筛选出审核状态为待审核的业务数据,作为修改后的业务数据。In one of the embodiments, the server searches the blockchain for business data corresponding to the business data identifier and whose review status is pending review (or unreviewed) from the blockchain according to the review data query request, as the modified business data. The server searches for the business data corresponding to the business data identifier in the blockchain, and filters out the business data whose review status is pending review from the business data found, as the modified business data.
在其中一个实施例中,服务器在区块链中查找业务数据标识对应的业务数据,并从查找到的业务数据中筛选出最新版本的、且审核状态为待审核(或未审核)的业务数据,作为修改后的业务数据。In one of the embodiments, the server searches for the business data corresponding to the business data identifier in the blockchain, and filters out the latest version of the business data whose review status is pending review (or unreviewed) from the found business data , As the revised business data.
S208,将审核意见数据作为修改后的业务数据的审核状态,并与修改后的业务数据关 联存储至区块链中。S208: Use the review opinion data as the review status of the modified business data, and store it in the blockchain in association with the modified business data.
具体地,当接收到第二终端反馈的审核意见数据时,服务器将接收到的审核意见数据作为修改后的业务数据的审核状态,并将该审核状态与修改后的业务数据关联存储至区块链中。可以理解,当接收到第二终端针对修改后的业务数据反馈的审核意见数据时,服务器根据审核意见数据确定相应修改后的业务数据的审核状态,并将所确定的审核状态与修改后的业务数据关联存储至区块链中。Specifically, when receiving the review opinion data fed back by the second terminal, the server uses the received review opinion data as the review status of the modified business data, and stores the review status in association with the modified business data in the block Chain. It can be understood that when receiving the review opinion data fed back by the second terminal for the modified business data, the server determines the review status of the corresponding modified business data according to the review opinion data, and compares the determined review status with the modified business data The data is stored in the blockchain.
在其中一个实施例中,服务器将审核状态与修改后的业务数据关联存储至区块链中时所对应的版本号,与根据业务数据修改请求将该修改后的业务数据存储至区块链中时所对应的版本号可以相同也可以不同。In one of the embodiments, the server associates the audit status and the modified business data with the corresponding version number when stored in the blockchain, and stores the modified business data in the blockchain according to the business data modification request The version number corresponding to the time can be the same or different.
在其中一个实施例中,当接收到第二终端反馈的审核意见数据、且审核意见数据为审核通过时,服务器将修改后的业务数据的审核状态确定为审核通过,并将表示审核通过的审核状态和修改后的业务数据关联存储至区块链中。当接收到第二终端反馈的审核意见数据、且审核意见数据为审核未通过时,服务器将修改后的业务数据的审核状态确定为审核未通过,并将表示审核未通过的审核状态和修改后的业务数据关联存储至区块链中。In one of the embodiments, when the review opinion data fed back by the second terminal is received and the review opinion data is approved, the server determines the review status of the modified business data as approved, and will indicate the approved review The status and modified business data are stored in the blockchain in association with each other. When the review opinion data fed back by the second terminal is received, and the review opinion data is that the review failed, the server determines the review status of the modified business data as the review failed, and will indicate the review status and the revised review status that the review failed The business data is stored in the blockchain.
在其中一个实施例中,当接收到第二终端针对修改的业务数据反馈的审核意见数据时,服务器将接收的审核意见数据作为该修改后的业务数据的审核状态,并获取当前系统时间作为审核时间戳,进而将该审核时间戳、审核状态和修改后的业务数据关联存储至区块链中。In one of the embodiments, when the review opinion data fed back by the second terminal for the modified business data is received, the server uses the received review opinion data as the review status of the modified business data, and obtains the current system time as the review Time stamp, and then store the audit time stamp, audit status, and modified business data in the blockchain.
S210,若接收到第一终端发送的携带有业务数据标识的业务数据查询请求,则根据业务数据查询请求从区块链中查找修改后的业务数据的审核状态。S210: If a business data query request carrying a business data identifier sent by the first terminal is received, the review status of the modified business data is searched from the blockchain according to the business data query request.
业务数据查询请求是用于触发业务数据查询操作的请求。业务数据查询请求中可携带有业务数据标识。The business data query request is a request used to trigger the business data query operation. The service data query request may carry the service data identifier.
具体地,第一终端实时检测预设触发条件,当检测到预设触发条件时,根据检测到的预设触发条件确定业务数据标识,根据所确定的业务数据标识生成业务数据查询请求,并将生成的业务数据查询请求发送至服务器。服务器在接收到第一终端发送的业务数据查询请求时,根据业务数据查询请求从区块链中查找与业务数据标识对应的修改后的业务数据,以及该修改后的业务数据的审核状态。预设触发条件比如检测到预设触发操作,或者,检测到当前系统时间与预设触发时间一致,或者,当前次触发业务数据查询请求后达到预设时长等。预设触发操作比如针对预设触发控件的点击、滑动或按压等触发操作。预设触发时间和预设时长可根据实际情况自定义。Specifically, the first terminal detects the preset trigger condition in real time, and when the preset trigger condition is detected, determines the service data identifier according to the detected preset trigger condition, generates the service data query request according to the determined service data identifier, and sends The generated business data query request is sent to the server. When receiving the business data query request sent by the first terminal, the server searches the blockchain for the modified business data corresponding to the business data identifier and the review status of the modified business data according to the business data query request. The preset trigger condition, for example, detects a preset trigger operation, or detects that the current system time is consistent with the preset trigger time, or the preset duration is reached after the current business data query request is triggered. The preset trigger operation is, for example, a trigger operation such as clicking, sliding, or pressing a preset trigger control. The preset trigger time and preset duration can be customized according to the actual situation.
可以理解,若服务器在将审核状态和修改后的业务数据关联存储至区块链中之后,接收到第一终端发送的业务数据查询请求,此时,业务数据标识对应的最新版本的业务数据为该修改后的业务数据。服务器根据接收到的业务数据查询请求,从区块链中查找与业务数据标识对应的最新版本的业务数据所对应的审核状态。It can be understood that if the server receives the service data query request sent by the first terminal after associating the audit status and the modified service data into the blockchain, at this time, the latest version of the service data corresponding to the service data identifier is The revised business data. According to the received business data query request, the server searches the blockchain for the review status corresponding to the latest version of the business data corresponding to the business data identifier.
在其中一个实施例中,第一终端根据预配置的预设触发条件定期触发业务数据查询请 求,并将触发生成的业务数据查询请求发送至服务器。服务器实时检测第一终端发送的业务数据查询请求,若接收到第一终端发送的携带有业务数据标识的业务数据查询请求,则从接收到的业务数据查询请求中提取业务数据标识,并根据提取的业务数据标识查询最新版本的业务数据。In one of the embodiments, the first terminal periodically triggers the service data query request according to a pre-configured preset trigger condition, and sends the triggered service data query request to the server. The server detects the service data query request sent by the first terminal in real time, and if it receives the service data query request carrying the service data identifier sent by the first terminal, it extracts the service data identifier from the received service data query request, and extracts it according to the extracted The business data identifier of Query the latest version of business data.
S212,当查找到的审核状态为审核未通过时,根据业务数据标识从区块链中查找最新版本、且审核状态为审核通过的目标业务数据,并将目标业务数据反馈至第一终端。S212: When the found review status is the review failed, search for the target business data of the latest version from the blockchain according to the business data identifier and the review status is the target business data that has passed the review, and feed back the target business data to the first terminal.
最新版本的业务数据是指版本号最新的业务数据,或入链时间最晚或最近(也就是最晚或最近入链)的业务数据,入链时间是指将业务数据写入区块链的时间。审核状态包括审核通过和审核未通过的状态。The latest version of the business data refers to the business data with the latest version number, or the business data with the latest or recent entry into the chain (that is, the latest or recent entry into the chain), and the entry time refers to the business data written into the blockchain time. The audit status includes approved status and failed audit status.
具体地,当从区块链中查找到的修改后的业务数据所对应的审核状态为审核未通过时,服务器根据业务数据查询请求中携带的业务数据标识,从区块链中查找与该业务数据标识对应的业务数据,从查找到的业务数据中选取最新版本的、且审核状态为审核通过的业务数据,作为查找到的目标业务数据,并将查找到的目标业务数据反馈至第一终端。服务器分别确定查找到的各业务数据的审核状态和版本号(或入链时间),并从查找到的业务数据中选取审核状态为审核通过、且版本号最新(或入链时间最晚)的业务数据,作为目标业务数据。Specifically, when the review status corresponding to the modified business data found in the blockchain is the review failed, the server searches the blockchain for the business data identifier carried in the business data query request. The business data corresponding to the data identification, select the latest version of the business data from the searched business data and the audit status is approved as the searched target business data, and feed back the searched target business data to the first terminal . The server separately determines the audit status and version number (or the time of entering the chain) of each business data found, and selects the audit status from the found business data as approved and the latest version number (or the latest entry time) Business data, as target business data.
可以理解,当查找到的修改后的业务数据所对应的审核状态为审核未通过时,服务器按照上述方式查询到的目标业务数据为与该修改后的业务数据对应的待修改的业务数据,也就是该修改后的业务数据所对应的修改前的业务数据。It can be understood that when the review status corresponding to the found modified business data is the review failed, the target business data queried by the server in the above manner is the business data to be modified corresponding to the modified business data. It is the business data before the modification corresponding to the modified business data.
在其中一个实施例中,当查找到的审核状态为审核未通过时,服务器在区块链中查找到与业务数据标识对应的一条或多条业务数据。当查找到多条业务数据时,服务器从该多条业务数据中选取最新版本的、且审核状态为审核通过的业务数据作为目标业务数据。当查找到一条业务数据时,服务器可将该条业务数据作为查找到的目标业务数据,也可进一步判断该条业务数据的审核状态是否为审核通过,若判定审核状态为审核通过,则将该条业务数据作为查找到的目标业务数据。可以理解的是,若在区块链中未查找到与业务数据标识对应的目标业务数据,服务器则向第一终端反馈表示业务数据查询失败的提示信息。In one of the embodiments, when the found audit status is that the audit failed, the server finds one or more pieces of business data corresponding to the business data identifier in the blockchain. When multiple pieces of business data are found, the server selects, from the multiple pieces of business data, the business data of the latest version and whose review status is approved as the target business data. When a piece of business data is found, the server can use the piece of business data as the target business data found, and can also further determine whether the review status of the piece of business data is approved. A piece of business data is used as the found target business data. It is understandable that if the target business data corresponding to the business data identifier is not found in the blockchain, the server will feed back to the first terminal prompt information indicating that the business data query has failed.
在其中一个实施例中,服务器从区块链中查找到的业务数据中携带有审核状态和版本号(或入链时间)。服务器从查找到的各业务数据中分别提取相应的审核状态和版本号(或入链时间)。In one of the embodiments, the service data found by the server from the blockchain carries the audit status and version number (or the time of entering the chain). The server extracts the corresponding review status and version number (or link time) from each business data found.
在其中一个实施例中,服务器针对已写入区块链的各业务数据,在区块链中存储有相应的审核状态和版本号(入链时间)。服务器根据业务数据查询请求从区块链中查找与业务数据标识对应的业务数据,以及各业务数据对应的审核状态和版本号(入链时间)。In one of the embodiments, the server stores the corresponding review status and version number (chain access time) in the blockchain for each business data that has been written into the blockchain. The server searches for the business data corresponding to the business data identifier from the blockchain according to the business data query request, as well as the review status and version number (in-chain time) corresponding to each business data.
在其中一个实施例中,服务器根据业务数据查询请求从区块链中查找与业务数据标识对应的、且审核状态为审核通过的业务数据,并从查找到的业务数据中选取版本号最新(或入链时间最晚)的业务数据,作为目标业务数据。In one of the embodiments, the server searches for the business data corresponding to the business data identifier from the blockchain according to the business data query request and the review status is approved, and selects the latest version number from the business data found (or The business data with the latest chain entry time) is used as the target business data.
在其中一个实施例中,步骤S212包括:根据业务数据标识从区块链中查找预存储的业务数据;从查找到的业务数据中筛选出审核状态为审核通过的业务数据;从筛选出的业务数据中选取最新版本的业务数据,作为目标业务数据。In one of the embodiments, step S212 includes: searching for pre-stored business data from the blockchain according to the business data identifier; filtering out the business data whose audit status is approved from the searched business data; Select the latest version of the business data from the data as the target business data.
具体地,服务器根据业务数据查询请求确定业务数据标识,并根据业务数据标识从区块链中查找对应于该业务数据标识预存储的多条业务数据。服务器分别确定该多条业务数据的审核状态,并从该多条业务数据中筛选出审核状态为审核通过的一条或多条业务数据。当筛选出多条业务数据时,服务器从筛选出的该多条业务数据中选取最新版本的业务数据,作为查找到的目标业务数据。当筛选出一条业务数据时,服务器则将筛选出的该条业务数据作为目标业务数据。Specifically, the server determines the service data identifier according to the service data query request, and according to the service data identifier, searches the blockchain for multiple pieces of pre-stored service data corresponding to the service data identifier. The server respectively determines the review status of the multiple pieces of business data, and filters out one or more pieces of business data whose review status is approved by the multiple pieces of business data. When multiple pieces of business data are filtered out, the server selects the latest version of the business data from the multiple pieces of filtered business data as the found target business data. When a piece of business data is filtered out, the server uses this piece of business data as the target business data.
在其中一个实施例中,服务器分别确定筛选出的各业务数据的入链时间,将各入链时间进行比较,以根据比较结果从筛选出的业务数据中选取入链时间最晚或最近的业务数据,作为目标业务数据。由此,目标业务数据是审核状态为审核通过、且最晚或最近入链(写入区块链)的业务数据。In one of the embodiments, the server separately determines the in-chain time of each service data that is filtered out, and compares the in-chain time to select the business with the latest or latest in-chain time from the filtered service data according to the comparison result Data as the target business data. Therefore, the target business data is the business data whose audit status is approved and entered the chain (written to the blockchain) at the latest or most recently.
在其中一个实施例中,服务器将根据业务数据标识从区块链中查询到的各业务数据,按照版本号(或入链时间)进行优先级排序,得到业务数据序列(或业务数据列表)。服务器按照版本号逆序(或入链时间降序)的排序方式对各业务数据进行优先级排序。版本号逆序的排序方式是指将版本号最新的业务数据排在最前,以此类推进行排序。入链时间降序的排序方式是指将最新或最近的入链时间对应的业务数据排在最前,以此往下进行排序,由此,版本号最新(入链时间最晚或最近)的业务数据在业务数据序列中的优先级最高。In one of the embodiments, the server will prioritize each service data queried from the blockchain according to the service data identifier and according to the version number (or link time) to obtain the service data sequence (or service data list). The server prioritizes the business data according to the reverse order of version number (or descending order of entry time). The sorting method of the version number in reverse order means that the business data with the latest version number is ranked first, and so on. The descending order of entry time means that the business data corresponding to the latest or most recent entry time is ranked first, and then sorted downward. Therefore, the business data with the latest version number (latest or latest entry time) It has the highest priority in the business data sequence.
进一步地,服务器从业务数据序列中筛选出审核状态为审核通过、且优先级最高的业务数据,作为目标业务数据。服务器按照优先级由高至低的顺序依次判断各业务数据的审核状态,当判定业务数据的审核状态为审核通过时,将该业务数据确定为目标业务数据,并停止判断操作。当判定业务数据的审核状态为审核未通过时,对于尚未判断审核状态的各业务数据,服务器返回至按照优先级由高至低的顺序依次判断各业务数据的审核状态的步骤继续执行,直至判定业务数据的审核状态为审核通过,或者针对业务数据序列中的各业务数据依次执行的判断操作执行完毕时,停止迭代。Further, the server filters out the business data whose review status is approved and has the highest priority from the business data sequence, as the target business data. The server sequentially judges the review status of each business data in the order of priority from high to low. When the review status of the business data is determined to be approved, the business data is determined as the target business data and the judgment operation is stopped. When it is determined that the review status of the business data is not passed, for each business data whose review status has not been determined, the server returns to the step of determining the review status of each business data in the order of priority from high to low and continues to execute until it is determined The review status of the business data is approved, or when the judgment operation performed sequentially for each business data in the business data sequence is completed, the iteration is stopped.
上述实施例中,从查找到的业务数据中初步筛选审核状态为审核通过的业务数据,并从初步筛选出的业务数据中选取最新版本的业务数据作为目标业务数据,以保证查找到的目标业务数据是由一方修改、且由另一方审核通过的业务数据,从而能够保证业务数据的一致性和业务数据处理的准确性。In the above-mentioned embodiment, the business data whose audit status is approved is initially selected from the business data found, and the latest version of the business data is selected as the target business data from the initially filtered business data to ensure the found target business Data is business data modified by one party and approved by the other party, so as to ensure the consistency of business data and the accuracy of business data processing.
在其中一个实施例中,从筛选出的业务数据中选取最新版本的业务数据,作为目标业务数据,包括:从筛选出的业务数据的版本号中提取时间戳;从筛选出的业务数据中选取提取的时间戳最新的业务数据,作为目标业务数据。In one of the embodiments, selecting the latest version of the business data from the filtered business data as the target business data includes: extracting the timestamp from the version number of the filtered business data; selecting from the filtered business data The latest business data with the extracted timestamp is used as the target business data.
版本号是版本的标识号,用于标识业务数据标识所对应的业务数据的版本。版本号包 括时间戳,还可包括随机数和/或业务数据标识。时间戳可用于唯一标识特定的时间或时间点,比如业务数据的入链时间。The version number is the identification number of the version, and is used to identify the version of the business data corresponding to the business data identifier. The version number includes a timestamp and can also include a random number and/or business data identification. The timestamp can be used to uniquely identify a specific time or point in time, such as the entry time of business data.
具体地,服务器分别确定筛选出的各业务数据的版本号,并提取各版本号中的时间戳。服务器将提取的各时间戳进行比较,以从各版本号中筛选出时间戳最新的版本号,并将筛选出的版本号对应的业务数据作为目标业务数据。Specifically, the server separately determines the version number of each service data that is filtered out, and extracts the timestamp in each version number. The server compares the extracted time stamps to filter out the latest version number of the time stamp from each version number, and uses the business data corresponding to the filtered version number as the target business data.
在其中一个实施例中,当从区块链中查找到业务数据标识对应的业务数据时,服务器分别确定各业务数据的审核状态和版本号,提取各版本号中的时间戳,以根据时间戳确定各业务数据的入链时间。服务器获取当前系统时间和预配置的预设时长,以当前系统时间作为时间段结束时间,并以预设时长作为时间段时长,根据该当前系统时间和预设时长确定时间段开始时间,进而由时间段开始时间和时间段结束时间确定时间段。服务器将各业务数据的入链时间分别与该时间段进行比较,以筛选出入链时间属于该时间段、且审核状态为审核通过的一个或多个业务数据。当筛选出一个业务数据时,将筛选出的该业务数据确定为目标业务数据;当筛选出多个业务数据时,从筛选出的该多个业务数据中选取入链时间最晚的业务数据,作为目标业务数据;当未筛选出业务数据时,则向第一终端反馈表示业务数据查询失败的提示信息。In one of the embodiments, when the business data corresponding to the business data identifier is found from the blockchain, the server separately determines the review status and version number of each business data, and extracts the timestamp in each version number so as to be based on the timestamp Determine the entry time of each business data. The server obtains the current system time and the pre-configured preset duration, uses the current system time as the end time of the time period, and uses the preset duration as the time period duration, determines the start time of the time period according to the current system time and the preset duration, and then The time period start time and the time period end time determine the time period. The server compares the in-chain time of each business data with the time period to filter one or more business data whose in-chain time belongs to the time period and whose audit status is approved. When a piece of business data is filtered out, the filtered business data is determined as the target business data; when multiple business data are filtered out, the business data with the latest chaining time is selected from the multiple business data filtered out, As the target business data; when the business data is not filtered out, a prompt message indicating that the business data query fails is fed back to the first terminal.
在其中一个实施例中,当接收到其他计算机设备发送的、与业务数据标识对应的业务数据查询请求时,服务器基于上述一个或多个实施例中提供的业务数据查找方式,从区块链中查找相应的目标业务数据。其他计算机设备比如第二终端或第三终端等。In one of the embodiments, when receiving a business data query request corresponding to a business data identifier sent by another computer device, the server uses the business data search method provided in one or more of the above embodiments to retrieve data from the blockchain. Find the corresponding target business data. Other computer equipment such as the second terminal or the third terminal.
在接收到第一终端发送的业务数据修改请求时,将对应确定的修改后的业务数据存储至区块链中,并向第二终端推送业务数据审核指令,进而将第二终端针对修改后的业务数据反馈的审核意见数据作为审核状态,且与该修改后的业务数据关联存储至区块链中。由此,基于区块链的不可篡改性来保证业务数据修改和审核意见数据的可追溯性和真实性,从而能够保证业务数据的处理准确性。进一步地,当接收到第一终端对应于业务数据标识发送的业务数据查询请求、且相应修改后的业务数据的审核状态为审核未通过时,则根据业务数据标识在区块链中查找最新版本、且审核状态为审核通过的目标业务数据。这样,当业务数据标识对应的最新版本的业务数据的审核状态为审核未通过时,从审核状态为审核通过的业务数据中选取最新版本的业务数据作为目标业务数据,以实现业务数据的回退,能够保证多业务方访问业务数据的一致性,从而能够进一步提高业务数据的处理准确性。When receiving the service data modification request sent by the first terminal, the corresponding determined modified service data is stored in the blockchain, and the service data review instruction is pushed to the second terminal, and the second terminal is then directed to the modified The review opinion data fed back by the business data is used as the review status, and is stored in the blockchain in association with the modified business data. Therefore, based on the non-tampering modification of the blockchain, the traceability and authenticity of business data modification and review opinion data can be guaranteed, so as to ensure the processing accuracy of business data. Further, when the business data query request sent by the first terminal corresponding to the business data identifier is received, and the review status of the corresponding modified business data is the review failed, the latest version is searched in the blockchain according to the business data identifier , And the audit status is the target business data that has passed the audit. In this way, when the review status of the latest version of the business data corresponding to the business data identifier is the review failed, the latest version of the business data is selected as the target business data from the business data whose review status is the approved business data to achieve the rollback of the business data , Can ensure the consistency of the business data accessed by multiple business parties, thereby further improving the processing accuracy of the business data.
在其中一个实施例中,步骤S208之后,上述业务数据回退方法还包括:当审核意见数据为审核未通过时,确定修改后的业务数据对应的修改人账号,并生成表示审核未通过的通知信息;将通知信息发送至以修改人账号登录的第三终端。In one of the embodiments, after step S208, the foregoing business data rollback method further includes: when the review opinion data is that the review failed, determining the modifier account corresponding to the modified business data, and generating a notification indicating that the review failed Information; the notification information is sent to the third terminal logged in with the modifier account.
修改人账号是修改人预先注册的、用于登录第三终端的账号。修改人可基于该修改人账号登录第三终端,或者借助于第三终端登录特定客户端、浏览器、网页或系统等,进而借助于第三终端查询并修改目标业务数据。The modifier account is an account pre-registered by the modifier and used to log in to the third terminal. The modifier can log in to the third terminal based on the modifier account, or log in to a specific client, browser, webpage or system with the third terminal, and then query and modify the target service data with the third terminal.
具体地,当第二终端针对修改后的业务数据反馈的审核意见数据为审核未通过时,服务器根据修改后的业务数据确定修改人账号,并根据审核意见数据生成表示审核未通过的通知信息,并将该通知信息发送至以该修改人账号登录的第三终端。第三终端将接收到通知信息通过修改人操作界面展示给修改人。服务器可从修改后的业务数据中提取修改人账号,也可根据修改后的业务数据从区块链中查找修改人账号。可以理解的是,第三终端可以是第一终端,具体根据修改人账号确定。Specifically, when the review opinion data fed back by the second terminal for the modified business data is that the review failed, the server determines the modifier account based on the modified business data, and generates notification information indicating that the review failed based on the review opinion data, And send the notification information to the third terminal logged in with the modifier account. The third terminal displays the received notification information to the modifier through the modifier operation interface. The server can extract the modifier's account from the modified business data, or find the modifier's account from the blockchain based on the modified business data. It can be understood that the third terminal may be the first terminal, which is specifically determined according to the modifier account.
在其中一个实施例中,服务器根据修改后的业务数据确定修改人标识,根据修改人标识查询预配置的修改人账号,或者根据修改人标识确定第三终端标识,进而根据修改人账号或第三终端标识确定接收通知信息的第三终端。In one of the embodiments, the server determines the modifier ID based on the modified business data, queries the pre-configured modifier account based on the modifier ID, or determines the third terminal ID based on the modifier ID, and then based on the modifier account or third The terminal identifier determines the third terminal that receives the notification information.
在其中一个实施例中,当审核意见数据表示审核通过时,服务器生成标识审核通过的通知信息,并将该通知信息发送至按照上述方式确定的第三终端。In one of the embodiments, when the review opinion data indicates that the review is passed, the server generates notification information identifying that the review is passed, and sends the notification information to the third terminal determined in the foregoing manner.
上述实施例中,在接收的审核意见数据为审核未通过时,触发生成表示审核未通过的通知信息并反馈至第三终端进行展示,以使得修改人能够根据审核结果执行后续操作,比如再次发起修改操作,以保证业务数据的一致性和准确性。In the above embodiment, when the received review opinion data is that the review has not passed, the generation of notification information indicating that the review has not passed is triggered and fed back to the third terminal for display, so that the modifier can perform follow-up operations based on the review results, such as initiating again Modify operations to ensure the consistency and accuracy of business data.
在其中一个实施例中,上述业务数据回退方法还包括:接收第一终端发送的与业务数据标识对应的修改数据查询请求;根据修改数据查询请求从区块链中查找业务数据标识对应的历史修改数据;将历史修改数据发送至第一终端。In one of the embodiments, the foregoing service data rollback method further includes: receiving a modified data query request corresponding to the service data identifier sent by the first terminal; and searching the history corresponding to the service data identifier from the blockchain according to the modified data query request Modify data; send historical modified data to the first terminal.
修改数据查询请求是用于触发修改数据查询操作的请求,用于指示服务器查找并反馈业务数据标识对应的历史修改数据。历史修改数据是指在当前系统时间之前修改业务数据标识所对应的业务数据得到的修改后的业务数据。The modified data query request is a request used to trigger a modified data query operation, and is used to instruct the server to find and feed back the historical modified data corresponding to the service data identifier. Historical modification data refers to modified business data obtained by modifying the business data corresponding to the business data identifier before the current system time.
具体地,服务器接收第一终端发送的修改数据查询请求,解析该修改数据查询请求得到业务数据标识,并根据业务数据标识在区块链中查找该业务数据标识对应的历史修改数据,进而将查询到的历史修改数据发送至第一终端。Specifically, the server receives the modified data query request sent by the first terminal, parses the modified data query request to obtain the service data identifier, and searches the blockchain for historical modification data corresponding to the service data identifier according to the service data identifier, and then queries The received historical modification data is sent to the first terminal.
在其中一个实施例中,服务器根据业务数据标识在区块链中查找业务数据标识对应的业务数据,分别确定各业务数据的版本号(入链时间),根据各版本号(入链时间)从查找到的业务数据中筛选出历史修改数据。服务器将查找到的业务数据中剔除版本号最早(或入链时间最早)的业务数据之后的各业务数据,确定为历史修改数据。可以理解的是,第二终端也可借助于服务器按照上述方式从区块链中查找业务数据标识对应的历史修改数据。在其中一个实施例中,服务器可将业务数据标识对应的版本号最早(或入链时间最早)的业务数据,即初始创建的业务数据确定为历史修改数据。In one of the embodiments, the server searches for the business data corresponding to the business data identification in the blockchain according to the business data identification, and determines the version number of each business data (in-chain time) according to each version number (in-chain time) from The historical modification data is filtered out from the business data found. The server determines the business data after excluding the business data with the earliest version number (or the earliest access time) from the found business data as historical modification data. It is understandable that the second terminal can also use the server to search for historical modification data corresponding to the service data identifier from the blockchain in the foregoing manner. In one of the embodiments, the server may determine the business data with the earliest version number (or the earliest link time) corresponding to the business data identifier, that is, the initially created business data as historical modification data.
上述实施例中,通过查找并反馈历史修改数据,能够快速且直观的了解业务数据标识对应的各个版本的业务数据。In the foregoing embodiment, by searching and feeding back historical modification data, it is possible to quickly and intuitively understand the business data of each version corresponding to the business data identifier.
如图3所示,在其中一个实施例中,提供了一种业务数据回退方法,该方法具体包括以下步骤:As shown in Figure 3, in one of the embodiments, a business data rollback method is provided, and the method specifically includes the following steps:
S302,接收第一终端发送的携带有业务数据标识的业务数据修改请求。S302: Receive a service data modification request carrying a service data identifier sent by the first terminal.
S304,根据业务数据修改请求确定修改后的业务数据,将修改后的业务数据存储至区块链,并根据修改后的业务数据生成业务数据审核指令。S304: Determine the modified business data according to the business data modification request, store the modified business data in the blockchain, and generate a business data review instruction according to the modified business data.
S306,根据业务数据标识确定审核员账号。S306: Determine the auditor account number according to the business data identifier.
S308,将业务数据审核指令发送至以审核员账号登录的第二终端。S308: Send the business data review instruction to the second terminal logged in with the reviewer account.
S310,接收第二终端发送的与业务数据标识对应的审核数据查询请求。S310: Receive an audit data query request corresponding to the service data identifier sent by the second terminal.
S312,根据审核数据查询请求从区块链中查找业务数据标识对应的修改后的业务数据。S312: Search for modified business data corresponding to the business data identifier from the blockchain according to the audit data query request.
S314,将修改后的业务数据发送至第二终端进行展示,并接收第二终端针对修改后的业务数据反馈的审核意见数据。S314: Send the modified service data to the second terminal for display, and receive review opinion data fed back by the second terminal to the modified service data.
S316,将审核意见数据作为修改后的业务数据的审核状态,并与修改后的业务数据关联存储至区块链中。S316: Use the review opinion data as the review status of the modified business data, and store it in the blockchain in association with the modified business data.
S318,当审核意见数据为审核未通过时,确定修改后的业务数据对应的修改人账号,并生成表示审核未通过的通知信息。S318: When the review opinion data is that the review failed, determine the modifier account corresponding to the modified business data, and generate notification information indicating that the review failed.
S320,将通知信息发送至以修改人账号登录的第三终端。S320: Send the notification information to the third terminal logged in with the modifier account.
S322,若接收到第一终端发送的携带有业务数据标识的业务数据查询请求,则根据业务数据查询请求从区块链中查找修改后的业务数据的审核状态。S322: If a business data query request carrying a business data identifier sent by the first terminal is received, search for the review status of the modified business data from the blockchain according to the business data query request.
S324,当查找到的审核状态为审核未通过时,根据业务数据标识从区块链中查找预存储的业务数据。S324: When the found audit status is that the audit failed, search for pre-stored business data from the blockchain according to the business data identifier.
S326,从查找到的业务数据中筛选出审核状态为审核通过的业务数据。S326: Filter out the business data whose review status is the review passed from the found business data.
S328,从筛选出的业务数据的版本号中提取时间戳。S328: Extract a timestamp from the version number of the service data that is filtered out.
S330,从筛选出的业务数据中选取提取的时间戳最新的业务数据,作为目标业务数据,并将目标业务数据反馈至第一终端。S330: Select the extracted business data with the latest timestamp from the filtered business data as target business data, and feed back the target business data to the first terminal.
上述实施例中,在接收到第一终端修改得到并发送的修改后的业务数据时,向第二终端推送业务数据审核指令,以指示第二终端对该修改后的业务数据进行审核,并反馈审核意见数据,以确保区块链中更新的业务数据能够被多方知晓,从而能够提高业务数据的处理准确性。将接收的审核意见数据作为修改后的业务数据的审核状态,并与该修改后的业务数据关联存储至区块链中,以便于在接收到业务数据查询请求时能够根据审核状态快速查找到相应的目标业务数据。进一步地,当根据业务数据查询请求查找到的审核状态为审核未通过时,根据业务数据标识在区块链中查找最新版本的、且审核状态为审核通过的业务数据,作为反馈至第一终端的目标业务数据,以实现业务数据的回退,能够保证多方访问的业务数据的一致性,从而能够进一步提高业务数据的处理准确性。In the above embodiment, upon receiving the modified service data modified and sent by the first terminal, the service data review instruction is pushed to the second terminal to instruct the second terminal to review the modified service data and feed back Review the opinion data to ensure that the updated business data in the blockchain can be known to multiple parties, thereby improving the accuracy of business data processing. Use the received review opinion data as the review status of the modified business data, and store it in the blockchain in association with the modified business data, so that when a business data query request is received, the corresponding review status can be quickly found Target business data. Further, when the review status found according to the business data query request is the review failed, the latest version of the business data with the review status of the review passed in the blockchain is searched for in the blockchain according to the business data identifier, as feedback to the first terminal In order to realize the rollback of the business data, the consistency of the business data accessed by multiple parties can be guaranteed, and the processing accuracy of the business data can be further improved.
以业务数据为订单信息,业务数据标识为订单标识为例,假设要对订单信息中的地址信息进行修改。服务器接收第一终端发送的第一订单查询请求,根据第一订单查询请求从区块链中查找与订单标识对应的版本号最新(或入链时间最晚)、且审核状态为审核通过的订单信息,作为待修改的订单信息,并将该待修改的订单信息反馈至第一终端。第一终 端将待修改的订单信息展示给修改人,检测该修改人针对待修改的订单信息触发的修改后的订单信息以实现对待修改的订单信息的修改,并将修改后的订单信息发送至服务器。服务器将修改后的订单信息写入区块链中,生成修改后的订单信息对应的订单审核指令,确定订单标识对应的审核员账号,并将订单审核指令发送至以审核员账号登录的第二终端。Taking the business data as the order information and the business data identifier as the order identifier as an example, it is assumed that the address information in the order information needs to be modified. The server receives the first order query request sent by the first terminal, and according to the first order query request, searches the blockchain for the order whose version number corresponding to the order identifier is the latest (or the latest chain entry time) and whose review status is approved The information is used as the order information to be modified, and the order information to be modified is fed back to the first terminal. The first terminal displays the order information to be modified to the modifier, detects the modified order information triggered by the modifier for the order information to be modified to modify the order information to be modified, and sends the modified order information to server. The server writes the modified order information into the blockchain, generates an order review instruction corresponding to the modified order information, determines the auditor account corresponding to the order identifier, and sends the order review instruction to the second person logged in with the auditor account terminal.
进一步地,第二终端根据订单审核指令确定订单标识,借助于服务器根据订单标识从区块链中查找待审核的修改后的订单信息,将该修好后的订单信息展示给审核员,并检测审核员对应触发的审核意见数据,进而将审核意见数据反馈至服务器。服务器将接收的审核意见数据作为修改后的业务数据的审核状态,并将该审核状态和修改后的业务数据关联存储至区块链中。当审核状态为审核未通过时,服务器向第一终端反馈表示审核未通过的通知信息。Further, the second terminal determines the order identification according to the order review instruction, and finds the revised order information to be reviewed from the blockchain with the help of the server according to the order identification, displays the repaired order information to the auditor, and checks and reviews The auditor responds to the triggered audit opinion data, and then feeds the audit opinion data back to the server. The server uses the received review opinion data as the review status of the modified business data, and stores the review status and the modified business data in a block chain. When the review status is the review failed, the server feeds back notification information indicating that the review failed to the first terminal.
进一步地,当接收到第一终端发送的第二订单查询请求时,服务器从区块链中查找修改后的订单信息所对应的审核状态。当查询到的审核状态为审核未通过时,服务器根据订单标识从区块链中,查找该订单标识当前对应的版本号最新(或入链时间最晚)、且审核状态为审核通过的订单信息,作为反馈至第一终端的目标订单信息。Further, when receiving the second order query request sent by the first terminal, the server searches the blockchain for the review status corresponding to the modified order information. When the queried audit status is that the audit has not passed, the server searches the blockchain according to the order ID to find the current version number corresponding to the order ID is the latest (or the latest time to enter the chain), and the audit status is the order information that has passed the audit , As the target order information fed back to the first terminal.
在其中一个实施例中,服务器可基于现有技术中的区块链入链流程对修改后的业务数据执行入链操作,在此不再赘述。In one of the embodiments, the server can perform the chain-in operation on the modified business data based on the blockchain-in-chain process in the prior art, which will not be repeated here.
应该理解的是,虽然图2-3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowchart of FIGS. 2-3 are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless specifically stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least some of the steps in Figure 2-3 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
在其中一个实施例中,如图4所示,提供了一种业务数据回退装置400,包括:接收模块402、存储模块404、审核模块406、查找模块408和反馈模块410,其中:In one of the embodiments, as shown in FIG. 4, a service data rollback apparatus 400 is provided, including: a receiving module 402, a storage module 404, an audit module 406, a search module 408, and a feedback module 410, wherein:
接收模块402,用于接收第一终端发送的携带有业务数据标识的业务数据修改请求;The receiving module 402 is configured to receive a service data modification request carrying a service data identifier sent by the first terminal;
存储模块404,用于根据业务数据修改请求确定修改后的业务数据,将修改后的业务数据存储至区块链,并根据修改后的业务数据生成业务数据审核指令;The storage module 404 is configured to determine the modified business data according to the business data modification request, store the modified business data on the blockchain, and generate business data review instructions based on the modified business data;
审核模块406,用于根据业务数据标识确定第二终端,将业务数据审核指令发送至第二终端,并接收第二终端针对业务数据审核指令反馈的审核意见数据;The review module 406 is configured to determine the second terminal according to the business data identifier, send the business data review instruction to the second terminal, and receive review opinion data fed back by the second terminal in response to the business data review instruction;
存储模块404,还用于将审核意见数据作为修改后的业务数据的审核状态,并与修改后的业务数据关联存储至区块链中;The storage module 404 is also used to use the review opinion data as the review status of the modified business data, and store it in the blockchain in association with the modified business data;
查找模块408,用于若接收到第一终端发送的携带有业务数据标识的业务数据查询请求,则根据业务数据查询请求从区块链中查找修改后的业务数据的审核状态;The search module 408 is configured to, if a business data query request carrying a business data identifier sent by the first terminal is received, search for the review status of the modified business data from the blockchain according to the business data query request;
反馈模块410,用于当查找到的审核状态为审核未通过时,根据业务数据标识从区块链中查找最新版本、且审核状态为审核通过的目标业务数据,并将目标业务数据反馈至第一终端。The feedback module 410 is used to find the latest version of the target business data from the blockchain according to the business data identifier and the review status is the approved target business data, and feed the target business data back to the first One terminal.
在其中一个实施例中,反馈模块410,还用于根据业务数据标识从区块链中查找预存储的业务数据;从查找到的业务数据中筛选出审核状态为审核通过的业务数据;从筛选出的业务数据中选取最新版本的业务数据,作为目标业务数据。In one of the embodiments, the feedback module 410 is also used to search for pre-stored business data from the blockchain according to the business data identifier; filter out the business data whose audit status is approved by the searched business data; The latest version of the business data is selected from the output business data as the target business data.
在其中一个实施例中,反馈模块410,还用于从筛选出的业务数据的版本号中提取时间戳;从筛选出的业务数据中选取提取的时间戳最新的业务数据,作为目标业务数据。In one of the embodiments, the feedback module 410 is further configured to extract a time stamp from the version number of the filtered service data; select the latest service data with the extracted time stamp from the filtered service data as the target service data.
在其中一个实施例中,审核模块406,还用于根据业务数据标识确定审核员账号;将业务数据审核指令发送至以审核员账号登录的第二终端;业务数据审核指令用于指示第二终端将修改后的业务数据进行展示,并获取修改后的业务数据对应的审核意见数据。In one of the embodiments, the audit module 406 is also used to determine the auditor account according to the business data identifier; send the business data audit instruction to the second terminal logged in with the auditor account; the business data audit instruction is used to instruct the second terminal Display the modified business data and obtain the review opinion data corresponding to the modified business data.
在其中一个实施例中,审核模块406,还用于接收第二终端发送的与业务数据标识对应的审核数据查询请求;根据审核数据查询请求从区块链中查找业务数据标识对应的修改后的业务数据;将修改后的业务数据发送至第二终端进行展示,并接收第二终端针对修改后的业务数据反馈的审核意见数据。In one of the embodiments, the audit module 406 is further configured to receive the audit data query request corresponding to the service data identifier sent by the second terminal; according to the audit data query request, find the modified data corresponding to the service data identifier from the blockchain Business data: Send the modified business data to the second terminal for display, and receive the review opinion data that the second terminal feedbacks on the modified business data.
在其中一个实施例中,反馈模块410,还用于当审核意见数据为审核未通过时,确定修改后的业务数据对应的修改人账号,并生成表示审核未通过的通知信息;将通知信息发送至以修改人账号登录的第三终端。In one of the embodiments, the feedback module 410 is also used to determine the modifier account corresponding to the modified business data when the review opinion data is that the review failed, and generate notification information indicating that the review failed; and send the notification information To the third terminal logged in with the modifier account.
在其中一个实施例中,接收模块402,还用于接收第一终端发送的与业务数据标识对应的修改数据查询请求;查找模块408,还用于根据修改数据查询请求从区块链中查找业务数据标识对应的历史修改数据;反馈模块410,还用于将历史修改数据发送至第一终端。In one of the embodiments, the receiving module 402 is also used to receive the modified data query request corresponding to the service data identifier sent by the first terminal; the search module 408 is also used to find the service from the blockchain according to the modified data query request The historical modification data corresponding to the data identifier; the feedback module 410 is also used to send the historical modification data to the first terminal.
关于业务数据回退装置的具体限定可以参见上文中对于业务数据回退方法的限定,在此不再赘述。上述业务数据回退装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the service data rollback device, please refer to the above limitation on the service data rollback method, which will not be repeated here. Each module in the above-mentioned service data rollback device can be implemented in whole or in part by software, hardware, and a combination thereof. The foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
在其中一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图5所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储业务数据标识对应的业务数据(包括目标业务数据和修改后的业务数据)和审核状态。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种业务数据回退方法。In one of the embodiments, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. 5. The computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The database of the computer equipment is used to store the business data (including target business data and modified business data) corresponding to the business data identifier and the audit status. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer-readable instruction is executed by the processor to realize a business data rollback method.
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构 的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的业务数据回退方法的步骤。A computer device including a memory and one or more processors. The memory stores computer readable instructions. When the computer readable instructions are executed by one or more processors, the one or more processors can realize any one of the present application. The steps of the business data rollback method provided in the embodiment.
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的业务数据回退方法的步骤。One or more non-volatile computer-readable storage media storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors implement any one of the embodiments of the present application. Provide the steps of the business data rollback method.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through computer-readable instructions, which can be stored in a non-volatile computer. In a readable storage medium, when the computer-readable instructions are executed, they may include the processes of the above-mentioned method embodiments. Any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, they should It is considered as the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can be made, and these all fall within the protection scope of this application. Therefore, the scope of protection of the patent of this application shall be subject to the appended claims.