WO2021174882A1 - 数据分片校验方法、装置、计算机设备及可读存储介质 - Google Patents

数据分片校验方法、装置、计算机设备及可读存储介质 Download PDF

Info

Publication number
WO2021174882A1
WO2021174882A1 PCT/CN2020/125114 CN2020125114W WO2021174882A1 WO 2021174882 A1 WO2021174882 A1 WO 2021174882A1 CN 2020125114 W CN2020125114 W CN 2020125114W WO 2021174882 A1 WO2021174882 A1 WO 2021174882A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
user
service
key value
hash
Prior art date
Application number
PCT/CN2020/125114
Other languages
English (en)
French (fr)
Inventor
何自兴
张德顺
张汉文
张煜清
冯宇
冯玉娜
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021174882A1 publication Critical patent/WO2021174882A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/137Hash-based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • G06F16/152File search processing using file content signatures, e.g. hash values
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems

Definitions

  • This application relates to the field of cloud service technology, and in particular to a data fragment verification method, device, computer equipment, and readable storage medium, which use a hash code generated by the hash technology of the blockchain.
  • Data interaction is generated between the distributed client terminal and the centralized server, such as virtual currency transaction scenarios such as transactions, financial management, financial management, etc., and data synchronization is finally completed.
  • virtual currency transaction scenarios such as transactions, financial management, financial management, etc.
  • data synchronization is finally completed.
  • the client terminal The financial information stored in the centralized server should be consistent with the financial information stored in the centralized server.
  • the centralized server may have synchronization failures when synchronizing data with the distributed clients, and the synchronized data obtained after the synchronization failure is often still stored in the user.
  • the data between the distributed client and the centralized server is different, and it is difficult to be identified.
  • the current approach is to extract the user data in the distributed client and enter it into the database of the centralized server, and store the user data in the database. Compare with service data one by one.
  • the inventor realized that the comparison process of this approach will not only call a large amount of resources of the centralized server, but also that the comparison process will be very slow due to the huge amount of data; and because the comparison process is in the database Therefore, the client cannot call other information in the database of the centralized server during the execution of the comparison operation, which greatly reduces the efficiency of data interaction and calling between the client and the server.
  • the purpose of this application is to provide a data slice verification method, device, computer equipment, and readable storage medium, which are used to solve the problem that the comparison process in the prior art will be very slow, and the user cannot perform the comparison operation. Calling other information in the database of the centralized server during execution greatly reduces the efficiency of data interaction and calling between the client and the server.
  • this application provides a data fragment verification method for verifying the synchronized data between a distributed client and a centralized server, including:
  • a verification process is performed to verify the user target data and the service target data to identify abnormal data therein.
  • this application also provides a data fragment verification device, including:
  • the data acquisition module is used to acquire the user data of the distributed client and the service data of the centralized server;
  • the fragmentation service module is used to execute the fragmentation process to separately fragment the user data and service data, and aggregate user data elements that contain the same user hash code in the user data to obtain user fragmentation data, and Summarize the service data elements that contain the same service hash code in the service data to obtain service fragment data; wherein, the user data element is the smallest unit that constitutes the user data, and the service data element constitutes the service The smallest unit of data;
  • the target recognition module is used to call a distributed system containing at least one computing server to execute parallel processes to obtain user hash codes and service hash codes with the same value from user fragment data and service fragment data, as well as User target data and service target data corresponding to the user hash code and the service hash code;
  • the verification service module is used to perform a verification process to verify the user target data and the service target data to identify abnormal data therein.
  • this application also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor.
  • the processor of the computer device executes the computer program.
  • Data fragment verification method, the data fragment verification method includes:
  • a verification process is performed to verify the user target data and the service target data to identify abnormal data therein.
  • the present application also provides a computer-readable storage medium, the readable storage medium stores a computer program, and the computer program stored in the readable storage medium is executed by a processor to realize data slicing Verification methods, data fragment verification methods include:
  • a verification process is performed to verify the user target data and the service target data to identify abnormal data therein.
  • the data fragment verification method, device, computer equipment, and readable storage medium provided in this application avoid data verification in the database of the centralized server by obtaining user data on the distributed user side and service data of the centralized server.
  • the server needs to consume a lot of resources for data verification, and cannot provide data call services for the user end, which leads to the problem of reduced efficiency of data interaction and call between the user end and the server.
  • the user data and service data are fragmented by executing the fragmentation process, which helps to improve the efficiency of data verification; the parallel process executed by the distributed system helps to improve the identification efficiency of the user target data and user service data; by distribution
  • Each computing server in the system separately performs a verification process on the user target data and service target data it obtains, which not only improves the technical effect of data verification efficiency, but also calls an external distributed system to verify the user target data and service target data.
  • the verification avoids occupying the memory and computing power of the centralized server, thereby avoiding the problem that the current client cannot call other information in the database of the centralized server during the execution of the comparison operation, which greatly improves the client The efficiency of data interaction and invocation with the server.
  • FIG. 1 is a flowchart of Embodiment 1 of a method for verifying data fragments according to this application;
  • FIG. 2 is a schematic diagram of the environmental application of the data fragment verification method in the second embodiment of the data fragment verification method of this application;
  • FIG. 5 is a flowchart of the parallel process in the second embodiment of the data fragment verification method of the present application.
  • FIG. 6 is a flowchart of the verification process in the second embodiment of the data fragment verification method of the present application.
  • FIG. 7 is a flowchart of determining whether the target file corresponding to the user key value is consistent with the target file corresponding to the service key value in the second embodiment of the data fragment verification method of the present application;
  • FIG. 8 is a schematic diagram of program modules of Embodiment 3 of the data fragment verification device of this application.
  • FIG. 9 is a schematic diagram of the hardware structure of the computer device in the fourth embodiment of the computer device of this application.
  • a data fragment verification method of this embodiment is used to verify the synchronized data between a distributed client and a centralized server, including:
  • S101 Obtain user data of a distributed client and service data of a centralized server.
  • S104 Perform a fragmentation process to separately fragment the user data and service data, summarize user data elements that contain the same user hash code in the user data to obtain user fragmentation data, and summarize the service data
  • the service data elements containing the same service hash code in the service data element obtain the service fragment data; wherein, the user data element is the smallest unit that constitutes the user data, and the service data element is the smallest unit that constitutes the service data.
  • S106 Invoke a distributed system including at least one computing server to execute a parallel process to obtain user hash codes and service hash codes with the same value from the user slice data and service slice data, and to obtain the same value as the user hash code.
  • the user target data and service target data corresponding to the Greek code and the service hash code.
  • S107 Perform a verification process to verify the user target data and the service target data to identify abnormal data therein.
  • the user data of the distributed client side and the service data of the centralized server are obtained to avoid data verification in the database of the centralized server, which causes the server to consume a large amount of resources for data verification.
  • the inability to provide data call services for the user end leads to the problem of reduced efficiency of data interaction and call between the user end and the server.
  • data interaction is generated between the distributed client and the centralized server, such as virtual currency transaction scenarios such as transactions, financial management, and wealth management, and data synchronization is finally completed, such as: after the virtual currency transaction ,
  • the financial information stored in the user terminal such as user data in this application
  • the financial information stored in the centralized server such as service data in this application
  • a distributed client purchases a fund worth 1 million in a centralized server (such as fund company B) (the data interaction), and the distribution is synchronized through the data
  • the financial information of "investor A purchased a fund worth 1 million in fund company B" is stored in the distributed client terminal and the centralized server, respectively, as the user data of the distributed client terminal and the service data of the centralized server.
  • the user data is the synchronization data stored in the distributed user terminal after the data interaction process and the data synchronization is completed; the service data is the data synchronization data after the data interaction process is completed , The synchronized data stored in the centralized server.
  • the user data and service data are sharded by executing the sharding process to facilitate the use of the computing servers in the distributed system to obtain the sharded data, which helps to improve the efficiency of data verification; the parallel process is executed through the distributed system to Obtain user hash codes and service hash codes with the same value, and obtain user target data and service target data corresponding to the user hash codes and service hash codes, respectively, so as to improve the performance of the user target data and user service data.
  • each computing server in the distributed system performs a verification process on the user target data and service target data obtained by each computing server to identify the abnormal data, which not only achieves the technical effect of improving the efficiency of data verification, but also calls external
  • the distributed system checks the user target data and the service target data to avoid occupying the memory and computing power of the centralized server, thereby avoiding the current user’s inability to call the centralized server during the execution of the comparison operation.
  • the problem of other information in the database greatly improves the efficiency of data interaction and invocation between the client and the server.
  • the user hash code in this embodiment is a hash code obtained by performing a hash operation on the user key value key of the data obtained by the first hash algorithm in the hashmap method;
  • the service The hash code is a hash code obtained by performing a hash operation on the obtained service key value key through the first hash algorithm in the hashmap method. Since the hash operation on the key by the hash algorithm belongs to the prior art, the hash algorithm and its operation principle are not described here.
  • This embodiment is a specific application scenario of the foregoing Embodiment 1. Through this embodiment, the method provided by this application can be described more clearly and specifically.
  • Fig. 2 schematically shows an environmental application diagram of the data fragment verification method according to the second embodiment of the present application.
  • the authentication server 2 where the data fragment verification method is located is connected to the distributed client 3, the centralized server 4, and the distributed system 5 via a network; the server 2 may pass through one or more networks
  • the network may include various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and/or the like.
  • the network may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, and/or the like.
  • the network may include wireless links, such as cellular links, satellite links, Wi-Fi links, and/or the like;
  • the client terminal in the distributed client terminal 3 may be a smart phone or a tablet computer that stores user data , notebook computers, desktop computers, and other computer equipment,
  • the centralized server may be a server or a server system cluster storing service data, and the computing server in the distributed system may be a service system pre-stored with a check process.
  • FIG. 3 is a specific method flowchart of a data fragment verification method provided by an embodiment of the present application. The method specifically includes steps S201 to S208.
  • S201 Obtain user data of a distributed client and service data of a centralized server.
  • data interaction is generated between the distributed client and the centralized server, such as virtual currency transaction scenarios such as transactions, financial management, wealth management, etc.
  • data synchronization is finally completed, such as: after the virtual currency transaction,
  • the financial information stored in the user terminal (such as user data in this application) and the financial information stored in the centralized server (such as service data in this application) should be consistent.
  • a distributed client such as investor A purchases a fund worth 1 million in a centralized server (such as fund company B) (the data interaction), and the distribution is synchronized through the data
  • the financial information of "investor A purchased a fund worth 1 million in fund company B" is stored in the distributed client terminal and the centralized server, respectively, as the user data of the distributed client terminal and the service data of the centralized server.
  • the user data is the synchronization data stored in the distributed user terminal after the data interaction process and the data synchronization is completed;
  • the service data is the data synchronization data after the data interaction process is completed ,
  • the synchronized data stored in the centralized server.
  • the acquired user data and service data may be a fund change table.
  • the server needs to consume a lot of resources for data verification, and cannot provide data call services for the user end, resulting in a reduction in the efficiency of data interaction and call between the user end and the server
  • the user data of the distributed user terminal and the service data of the centralized server are obtained to avoid the above problems.
  • the user key value is a user invalid key value and stored in a preset abnormal database, and the user invalid key value is deleted from the user data.
  • user data is usually stored in the form of key-value pairs in the distributed user terminal, where the user key-value is the key of the key-value pair, and the target file is the key-value pair. Therefore, for a user key value (that is: key) without a target file (value), the user key value is invalid.
  • the formation of this user key value must be an abnormal operation in the distributed client.
  • the user key value is the invalid user key value and stored in the preset exception database, so as to remind the administrator of the occurrence of the abnormality, by deleting the invalid user key value from the user data,
  • the user key value in the user data can be sequentially identified through the polling mechanism, and the user key value corresponding to the user key value can be retrieved.
  • the target file if the target file can be retrieved, it means that the user key has a corresponding target file; if the target file cannot be retrieved, it means that the user key does not have a corresponding target file.
  • S203 Verify whether the service key value in the service data has a corresponding target file.
  • the service key value is a service invalid key value and stored in a preset exception database, and the service invalid key value is deleted from the service data.
  • service data is usually stored in the form of key-value pairs in a centralized server. Therefore, for a service key value (ie: key) without a target file (value), the service key value is Invalid, the formation of this service key must be an abnormal operation in the centralized server. Therefore, the service key is set to the invalid service key and stored in the preset exception database to facilitate reminder management In the event of abnormal occurrence, the invalid service key value is deleted from the service data to ensure that all information in the service data used for verification is valid.
  • S204 Perform a fragmentation process to separately fragment the user data and service data, summarize user data elements that contain the same hash code in the user data to obtain user fragmentation data, and summarize the service data
  • Service data elements containing the same hash code obtain service fragment data; wherein, the user data element is the smallest unit that constitutes the user data, and the service data element is the smallest unit that constitutes the service data.
  • this step divides the user data and service data by executing the fragmentation process, so that each computing server in the distributed system can obtain the fragmented data separately, which helps to improve the efficiency of data checking.
  • the user data is fragmented by using the hash consistency fragmentation rule to obtain at least one user fragmentation data
  • the user fragmentation data is entered into the preset user record table, and the hash is used.
  • the consistent fragmentation rule fragments the service data to obtain at least one service fragmentation data.
  • the fragmentation process includes:
  • S41 Obtain a user hash table of user data and a service hash table of service data; wherein, the user hash table reflects the storage location of each user data element in the user data in the distributed user terminal, so The service hash table reflects the storage location of each service data element in the service data in the centralized server.
  • the user hash table and service hash table namely: hashmap
  • hashmap is a data structure that stores user data in an array, and each user data element or service data element will be key-
  • the form of value pair is stored as an entry in the user hash table or service hash table, and the entry is the smallest unit of data in the hash table, where Entry is a key value stored in the hashmap
  • the right unit module is a data structure that stores user data in an array, and each user data element or service data element will be key-
  • the form of value pair is stored as an entry in the user hash table or service hash table, and the entry is the smallest unit of data in the hash table, where Entry is a key value stored in the hashmap The right unit module.
  • S42 Identify the hash bucket corresponding to the hash code in the user hash table, extract the user data elements in the hash bucket and summarize the user segment data; and identify the hash code in the service hash table
  • the corresponding hash bucket extracts and summarizes the service data elements in the hash bucket to obtain service fragment data.
  • the get function in the hashmap is used to obtain the hash code hashcode in the user hash table and the service hash table, where hashcode is the hash bucket number that stores the user data element and the service data element.
  • hashcode is the hash bucket number that stores the user data element and the service data element.
  • the user data elements stored in the same hash bucket are aggregated to form user fragmentation data
  • the service data elements stored in the same hash bucket are aggregated to form service fragmentation data, so that user fragmentation data and service fragmentation data can be based on the hash bucket.
  • the Greek codes correspond to each other, so that the user segment data and the service segment data of the same hash code can be compared through the parallel execution of the verification process, so as to improve the efficiency of data verification.
  • S205 Enter the user segment data into a preset user record table, and load the user status tag on the user segment data in the user record table; and enter the service segment data into the preset user record table. In the service record table, and load the service status label on the service fragment data in the service record table.
  • this step is to set the user record table and the service record table, and load the user shard data
  • the status tag may include: checked, unchecked, and checked, to clarify the current status of each piece of data, so as to prevent the distributed system from obtaining the checked and checked user pieces Fragmentation of data and service data improves the execution efficiency of data verification operations.
  • S206 Invoke a distributed system including at least one computing server to execute a parallel process to obtain user hash codes and service hash codes with the same value from the user slice data and service slice data, and the same value as the user hash code.
  • the user target data and service target data corresponding to the Greek code and the service hash code.
  • a parallel process is executed through a distributed system to obtain user hash codes and service hash codes with the same value, and obtain user target data and service target data corresponding to the user hash codes and service hash codes, respectively, to Improve the identification efficiency of the user target data and user service data.
  • the parallel process includes:
  • S61 Invoke the computing server in the distributed system, identify the content as the user status label to be verified and obtain user segment data corresponding to the user status label, and identify the content as the service status label to be verified, and obtain the The service fragment data corresponding to the service status tag.
  • S62 Identify the user hash code and the service hash code with the same value in the user fragment data and the service fragment data, and replace the user fragment data and service corresponding to the user hash code and the service hash code respectively.
  • Fragmented data set as user target data and service target data;
  • S63 Modify the user status label of the user segment data acquired by the computer server to be verified, and modify the service status label of the service segment data acquired by the computer server to be verified to avoid other calculations in the distributed system
  • the server obtains the user segment data and the service segment data.
  • the user status label and service status label are editable.
  • edit the content of the user status label and service status label so that they are “To be checked” is changed to "Checking in progress.”
  • S207 Perform a verification process to verify the user target data and the service target data to identify abnormal data therein.
  • the abnormality of the user target data and the service target data is identified through the verification process, so as to identify the abnormal data therein, and achieve the technical effect of improving the efficiency of data verification.
  • the verification process includes:
  • S71 Extract user key values and service key values with consistent values from the user target data and service target data, and determine whether the target file corresponding to the user key value is consistent with the target file corresponding to the service key value;
  • S75 Extract a service key value that does not exist in the user target data from the service target data, and set the service key value and its target file as service unilateral data.
  • user target data includes “data A, data B, and data C”
  • service target data includes “data A, data B, and data D”.
  • S76 Summarize the non-matching data, user unilateral data, and service unilateral data to obtain abnormal data.
  • construct a first abnormal hash table for storing the non-matching data construct a second abnormal hash table for users to store the user unilateral data, delete the service key value in the service unilateral data, and construct The third abnormal hash table used to store the unilateral data of the service, summarize the first abnormal hash table, the second abnormal hash table, and the third abnormal hash table to obtain abnormal data, and save the abnormal data To the abnormal database.
  • the non-matching data, user unilateral data, and service unilateral data are hashed through the hashmap algorithm to obtain an abnormal hash table. Since the hashmap algorithm and hash processing belong to the prior art, and the technical problem to be solved by this application is how to identify abnormal data and store it, the technical principles of the hashmap algorithm and hash processing are not repeated here.
  • the non-matching data after aggregating the non-matching data, user unilateral data, and service unilateral data to obtain abnormal data, it further includes:
  • the corresponding summary information is obtained based on the abnormal data.
  • the summary information is obtained by hashing the abnormal data, for example, obtained by the sha256s algorithm.
  • Uploading summary information to the blockchain can ensure its security and fairness and transparency to users.
  • the user equipment can download the summary information from the blockchain to verify whether the abnormal data has been tampered with.
  • the blockchain referred to in this example is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the step of judging whether the target file corresponding to the user key value is consistent with the target file corresponding to the service key value includes:
  • S71-1 Calculate the user key value and the service key value by using the preset first hash algorithm to obtain the user hash code and the service hash code.
  • the user hash code is a hash code obtained by performing a hash operation on the user key value key of the obtained data through the first hash algorithm in the hashmap method; the service hash code is obtained through a hashmap The first hash algorithm in the method performs a hash operation on the obtained service key value key to obtain a hash code hashcode.
  • S71-2 Determine whether the user hash code and the service hash code are consistent.
  • the user location code uses the second hash algorithm of the hashmap to perform a hash operation on the user hash code hashcode and the length of the target file value corresponding to the user key value key to obtain an array subscript;
  • the service location code uses the second hash algorithm of the hashmap to perform a hash operation on the service hash code hashcode and the length of the target file value corresponding to the service key value key to obtain an array subscript.
  • S71-5 Determine whether the user location code and the service location code are consistent according to the obtained user location code and service location code.
  • the user status label and service status label are editable.
  • edit the content of the user status label and service status label so that they are “Checking” is changed to "Checked.”
  • the user hash code and the service hash code are obtained by comparing the key in the user fragment data and the service fragment data, and compare them, and then obtain the user location code according to the user hash code and the service hash code It is compared with the service location code, so that the verification process does not need to compare the user fragment data and the service fragment data one by one, and the verification result can be obtained accurately, which improves the efficiency of data verification.
  • this step saves the abnormal data in the abnormal data table.
  • the first abnormal hash table, the second abnormal hash table, and the first abnormal hash table are stored in the abnormal data table.
  • Three abnormal hash tables are sent and stored in the preset abnormal database.
  • a data fragment verification device 1 of this embodiment includes:
  • the data acquisition module 11 is used to acquire the user data of the distributed client and the service data of the centralized server;
  • the fragmentation service module 14 is configured to execute the fragmentation process to separately fragment the user data and service data, and summarize user data elements that contain the same user hash code in the user data to obtain user fragmentation data, And summarizing the service data elements that contain the same service hash code in the service data to obtain the service fragment data; wherein, the user data element is the smallest unit that constitutes the user data, and the service data element constitutes the The smallest unit of service data;
  • the target recognition module 16 is used to call a distributed system including at least one computing server to execute parallel processes to obtain user hash codes and service hash codes with the same value from user fragment data and service fragment data, and User target data and service target data corresponding to the user hash code and the service hash code;
  • the verification service module 17 is used to perform a verification process to verify the user target data and the service target data to identify abnormal data therein.
  • the data fragment verification device 1 further includes:
  • the user verification module 12 is used to verify whether the user key value in the user data has a corresponding target file; if it is, the user key value is retained; if not, it is determined that the user key value is an invalid user key value And save it in a preset abnormal database, and delete the invalid key value of the user from the user data.
  • the data fragment verification device 1 further includes:
  • the service verification module 13 is used to verify whether the service key value in the service data has a corresponding target file; if it is, the service key value is retained; if not, it is determined that the service key value is an invalid service key value And save it in a preset abnormal database, and delete the service invalid key value from the service data.
  • the data fragment verification device 1 further includes:
  • the status tag module 15 is used to enter the user segment data into a preset user record table, and load the user status tag on the user segment data in the user record table; and segment the service The data is entered into the preset service record table, and the service status label is loaded on the service fragment data in the service record table.
  • the data fragment verification device 1 further includes:
  • the abnormality saving module 18 is used for saving abnormal data in a preset abnormal data table.
  • This technical solution is applied to the field of cloud computing technology for cloud services, by performing a sharding process on the acquired user data and service data, and calling a distributed system containing at least one computing server to execute parallel processes, so as to develop distributed systems.
  • Cluster calculations are performed to obtain user hash codes and service hash codes with the same value, as well as user target data and service target data corresponding to the user hash codes and service hash codes, and finally perform a verification process to identify abnormal data.
  • the present application also provides a computer device 6.
  • the components of the data slice verification device 1 in the third embodiment can be dispersed in different computer devices.
  • the computer device 6 can be a smart phone or a tablet that executes the program.
  • the computer device in this embodiment at least includes but is not limited to: a memory 61 and a processor 62 that can be communicatively connected to each other through a system bus, as shown in FIG. 9. It should be pointed out that FIG. 9 only shows a computer device with components, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
  • the memory 61 (ie, readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 61 may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device.
  • the memory 61 may also be an external storage device of the computer device, for example, a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), and a Secure Digital (SD) Card, Flash Card, etc.
  • the memory 61 may also include both the internal storage unit of the computer device and its external storage device.
  • the memory 61 is generally used to store an operating system and various application software installed in a computer device, such as the program code of the data slice verification device in the third embodiment, and so on.
  • the memory 61 may also be used to temporarily store various types of data that have been output or will be output.
  • the processor 62 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 62 is generally used to control the overall operation of the computer equipment.
  • the processor 62 is configured to run the program code or process data stored in the memory 61, for example, to run a data fragmentation verification device, to implement the data fragmentation verification methods of the first embodiment and the second embodiment.
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • Such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable and programmable memory Read memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disks, optical disks, servers, App application malls, etc. have computer programs stored thereon, and corresponding functions are realized when the programs are executed by the processor 62.
  • the computer-readable storage medium of this embodiment is used to store a data slicing verification device, and when executed by the processor 62, the data slicing verification method of the first embodiment and the second embodiment is implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请涉及云服务技术领域,公开了一种数据分片校验方法、装置、计算机设备及可读存储介质,包括:获取用户数据及服务数据;执行分片进程,以分别对用户数据和服务数据进行分片得到用户分片数据及服务分片数据;执行并行进程,以获取值相同的用户哈希码与服务哈希码,以及与用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;执行核对进程,以对用户目标数据和服务目标数据进行校验以识别其中的异常数据。本申请不仅提高了数据核对效率的技术效果,还避免了占用集中式服务器的内存和算力,进而避免了当前用户端无法在比对操作执行过程中调用集中式服务器的数据库中其他信息的问题,极大的提升了用户端与服务器之间数据交互与调用的效率。

Description

数据分片校验方法、装置、计算机设备及可读存储介质
本申请要求于2020年9月2日递交的申请号为CN 202010908571.0、名称为“数据分片校验方法、装置、计算机设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及云服务技术领域,尤其涉及一种数据分片校验方法、装置、计算机设备及可读存储介质,其使用到区块链的哈希技术所生成的哈希码。
背景技术
所述分布式用户端与集中式服务器之间产生数据交互,例如:交易,金融管理,理财等虚拟货币交易场景,并最终完成数据同步,如:经过所述虚拟货币交易后,所述用户端中保存的金融信息与集中式服务器中保存的金融信息应为一致。然而,由于分布式用户端的数量庞大,因此,集中式服务器在与分布式用户端进行数据同步时可能会出现同步失败等问题,而同步失败后所得到的同步数据往往会仍然保存在所述用户端和服务器中,导致分布式用户端与集中式服务器之间的数据产生差异,且很难被识别出来。
为保证所述服务器和用户端之间的数据是同步的,当前做法方法是,提取分布式用户端中的用户数据,并将其录入集中式服务器的数据库中,在所述数据库内将用户数据与服务数据进行一一比对。但是,发明人意识到,这种做法的比对过程不仅会调用集中式服务器的大量资源,而且由于数据量的庞大,其比对过程将十分缓慢;又由于所述比对过程是在数据库中进行的,因此,所述用户端无法在所述比对操作执行过程中调用集中式服务器的数据库中其他信息,极大的降低了用户端与服务器之间数据交互与调用的效率。
发明内容
本申请的目的是提供一种数据分片校验方法、装置、计算机设备及可读存储介质,用于解决现有技术存在的比对过程将十分缓慢,及用户端无法在所述比对操作执行过程中调用集中式服务器的数据库中其他信息,极大的降低了用户端与服务器之间数据交互与调用的效率的问题。
为实现上述目的,本申请提供一种数据分片校验方法,用于对分布式用户端和集中式服务器之间的同步数据进行校验,包括:
获取分布式用户端的用户数据,及集中式服务器的服务数据;
执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元;
调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;
执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
为实现上述目的,本申请还提供一种数据分片校验装置,包括:
数据获取模块,用于获取分布式用户端的用户数据,及集中式服务器的服务数据;
分片业务模块,用于执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元;
目标识别模块,用于调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;
核对业务模块,用于执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
为实现上述目的,本申请还提供一种计算机设备,其包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述计算机设备的处理器执行所述计算机程序时实现数据分片校验方法,所述数据分片校验方法包括:
获取分布式用户端的用户数据,及集中式服务器的服务数据;
执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元;
调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;
执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
为实现上述目的,本申请还提供一种计算机可读存储介质,所述可读存储介质上存储有计算机程序,所述可读存储介质存储的所述计算机程序被处理器执行时实现数据分片校验方法,数据分片校验方法包括:
获取分布式用户端的用户数据,及集中式服务器的服务数据;
执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元;
调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;
执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
本申请提供的数据分片校验方法、装置、计算机设备及可读存储介质,通过获取分布式用户端的用户数据及集中式服务器的服务数据,以避免在集中式服务器的数据库中进行数据核对,导致该服务器需要消耗大量资源进行数据核对,而无法为用户端提供数据调用服务,导致用户端与服务器之间数据交互与调用的效率降低的问题。
通过执行分片进程对用户数据和服务数据进行分片,有助于提高数据核对效率;通过分布式***执行并行进程,有助于提高所述用户目标数据和用户服务数据的识别效率;通过分布式***中各计算服务器分别对其获得的用户目标数据和服务目标数据执行核对进程,不仅提高了数据核对效率的技术效果,还因调用外部的分布式***对所述用户目标数据和服务目标数据进行核对,避免了占用集中式服务器的内存和算力,进而避免了当前用户端无法在所述比对操作执行过程中调用集中式服务器的数据库中其他信息的问题,极大的提升了用户端与服务器之间数据交互与调用的效率。
附图说明
图1为本申请数据分片校验方法实施例一的流程图;
图2为本申请数据分片校验方法实施例二中数据分片校验方法的环境应用示意图;
图3是本申请数据分片校验方法实施例二中数据分片校验方法的具体方法流程图;
图4是本申请数据分片校验方法实施例二中分片进程的流程图;
图5是本申请数据分片校验方法实施例二中并行进程的流程图;
图6是本申请数据分片校验方法实施例二中核对进程的流程图;
图7是本申请数据分片校验方法实施例二中判断所述用户键值对应的目标文件与所述服务键值对应的目标文件是否一致的流程图;
图8为本申请数据分片校验装置实施例三的程序模块示意图;
图9为本申请计算机设备实施例四中计算机设备的硬件结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
现提供以下实施例:
实施例一:
请参阅图1,本实施例的一种数据分片校验方法,用于对分布式用户端和集中式服务器之间的同步数据进行校验,包括:
S101:获取分布式用户端的用户数据,及集中式服务器的服务数据。
S104:执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元。
S106:调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据。
S107:执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
在示例性的实施例中,通过获取分布式用户端的用户数据,及集中式服务器的服务数据,以避免在集中式服务器的数据库中进行数据核对,导致该服务器需要消耗大量资源进行数据核对,而无法为用户端提供数据调用服务,导致用户端与服务器之间数据交互与调用的效率降低的问题。
需要说明的是,所述分布式用户端与集中式服务器之间产生数据交互,例如:交易,金融管理,理财等虚拟货币交易场景,并最终完成数据同步,如:经过所述虚拟货币交易后,所述用户端中保存的金融信息(如本申请中的用户数据)与集中式服务器中保存的金融信息(如本申请中的服务数据)应为一致。示例性地,分布式用户端(如:投资者A)在集中式服务器(如:基金公司B)中购买了一份价值100万的基金(所述数据交互),通过所述数据同步使分布式用户端和集中式服务器中分别保存有“投资者A在基金公司B购买了价值100万基金”的金融信息,以分别作为所述分布式用户端的用户数据和集中式服务器的服务数据。所述用户数据是经所述数据交互过程并完成所述数据同步后,保存在所述分布式用户端中的同步数据;所述服务数据是经所述数据交互过程并完成所述数据同步后,保存在所述集中式服务器中的同步数据。
通过执行分片进程对用户数据和服务数据进行分片,以便于使用分布式***中各计算服务器分别获取分片后的数据,有助于提高数据核对效率;通过分布式***执行并行进程,以获取值相同的用户哈希码和服务哈希码,获得分别与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据,以提高所述用户目标数据和用户服务数据的识别效率;通过分布式***中各计算服务器分别对其获得的用户目标数据和服务目标数据执行核对进程,以识别出其中的异常数据,不仅实现了提高数据核对效率的技术效果,还因调用外部 的分布式***对所述用户目标数据和服务目标数据进行核对,避免了占用集中式服务器的内存和算力,进而避免了当前用户端无法在所述比对操作执行过程中调用集中式服务器的数据库中其他信息的问题,极大的提升了用户端与服务器之间数据交互与调用的效率。
需要说明的是,本实施例中的所述用户哈希码是通过hashmap方法中的第一哈希算法将获得的数据的用户键值key进行hash运算后得到的哈希码hashcode;所述服务哈希码是通过hashmap方法中的第一哈希算法将获得的服务键值key进行hash运算后得到的哈希码hashcode。由于通过哈希算法对key进行hash运算属于现有技术,因此,关于哈算算法及其运算原理在此不做赘述。
实施例二:
本实施例为上述实施例一的一种具体应用场景,通过本实施例,能够更加清楚、具体地阐述本申请所提供的方法。
下面,以在运行有数据分片校验方法的服务器中,对获取用户数据及服务数据,并执行分片进程及调用至少包含有一个计算服务器的分布式***执行并行进程,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据,最后执行核对进程识别异常数据为例,来对本实施例提供的方法进行具体说明。需要说明的是,本实施例只是示例性的,并不限制本申请实施例所保护的范围。
图2示意性示出了根据本申请实施例二的数据分片校验方法的环境应用示意图。
在示例性的实施例中,数据分片校验方法所在的认证服务器2通过网络分别连接分布式用户端3、集中式服务器4和分布式***5;所述服务器2可以通过一个或多个网络提供服务,网络可以包括各种网络设备,例如路由器,交换机,多路复用器,集线器,调制解调器,网桥,中继器,防火墙,代理设备和/或等等。网络可以包括物理链路,例如同轴电缆链路,双绞线电缆链路,光纤链路,它们的组合和/或类似物。网络可以包括无线链路,例如蜂窝链路,卫星链路,Wi-Fi链路和/或类似物;所述分布式用户端3中的用户端可为保存有用户数据的智能手机、平板电脑、笔记本电脑、台式电脑等计算机设备,所述集中式服务器可为保存有服务数据的服务器或服务器***集群,所述分布式***中的计算服务器可为预存有核对进程的服务***。
图3是本申请一个实施例提供的一种数据分片校验方法的具体方法流程图,该方法具体包括步骤S201至S208。
S201:获取分布式用户端的用户数据,及集中式服务器的服务数据。
本步骤中,所述分布式用户端与集中式服务器之间产生数据交互,例如:交易,金融管理,理财等虚拟货币交易场景,并最终完成数据同步,如:经过所述虚拟货币交易后,所述用户端中保存的金融信息(如本申请中的用户数据)与集中式服务器中保存的金融信息(如本申请中的服务数据)应为一致。示例性地,分布式用户端(如:投资者A)在集中式服务器(如:基金公司B)中购买了一份价值100万的基金(所述数据交互),通过所述数据同步使分布式用户端和集中式服务器中分别保存有“投资者A在基金公司B购买了价值100万基金”的金融信息,以分别作为所述分布式用户端的用户数据和集中式服务器的服务数据。
所述用户数据是经所述数据交互过程并完成所述数据同步后,保存在所述分布式用户端中的同步数据;所述服务数据是经所述数据交互过程并完成所述数据同步后,保存在所述集中式服务器中的同步数据。
于本实施例中,获取的用户数据和服务数据可为资金变化表。
因此,为避免在集中式服务器的数据库中进行数据核对,导致该服务器需要消耗大量资源进行数据核对,而无法为用户端提供数据调用服务,导致用户端与服务器之间数据交互与调用的效率降低,本步骤通过获取分布式用户端的用户数据,及集中式服务器的服务数据以避免上述问题发生。
S202:验证所述用户数据中的用户键值是否具有与其对应的目标文件。
若是,则保留所述用户键值;
若否,则判定所述用户键值为用户无效键值并将其保存在预设的异常数据库中,及将所述用户无效键值从所述用户数据中删除。
通常的,用户数据在分布式用户端中通常以键值对(key-value)的形式保存,其中,所述用户键值是该键值对的键,所述目标文件是该键值对的值,因此,对于没有目标文件(value)的用户键值(即:key)来说,该用户键值是无效的,这种用户键值的形成必然是分布式用户端中出现了运行异常,因此,将所述用户键值为用户无效键值并将其保存在预设的异常数据库中,以便于提醒管理者异常的发生,通过将所述用户无效键值从所述用户数据中删除,以保证用于进行核对的用户数据中所有的信息都是有效的;于本实施例中,可以通过轮询机制依次识别用户数据中的用户键值,并调取与所述用户键值对应的目标文件,如果能够调取到目标文件,则说明该用户键值具有与其对应的目标文件,如果无法调取到目标文件,则说明该用户键值不具有与其对应的目标文件。
其中,于图3中,所述S202以以下标注展示:
S21:验证所述用户数据中的用户键值是否具有与其对应的目标文件。
S22:若是,则保留所述用户键值.
S23:若否,则判定所述用户键值为用户无效键值并将其保存在预设的异常数据库中,及将所述用户无效键值从所述用户数据中删除。
S203:验证所述服务数据中的服务键值是否具有与其对应的目标文件。
若是,则保留所述服务键值;
若否,则判定所述服务键值为服务无效键值并将其保存在预设的异常数据库中,及将所述服务无效键值从所述服务数据中删除。
通常的,服务数据在集中式服务器中通常以键值对(key-value)的形式保存,因此,对于没有目标文件(value)的服务键值(即:key)来说,该服务键值是无效的,这种服务键值的形成必然是集中式服务器中出现了运行异常,因此,将所述服务键值为服务无效键值并将其保存在预设的异常数据库中,以便于提醒管理者异常的发生,通过将所述服务无效键值从所述服务数据中删除,以保证用于进行核对的服务数据中所有的信息都是有效的。
其中,于图3中,所述S203以以下标注展示:
S31:验证所述服务数据中的服务键值是否具有与其对应的目标文件。
S32:若是,则保留所述服务键值。
S33:若否,则判定所述服务键值为服务无效键值并将其保存在预设的异常数据库中,及将所述服务无效键值从所述服务数据中删除。
S204:执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元。
为便于提高数据核对效率,本步骤通过执行分片进程对用户数据和服务数据进行分片,以便于使用分布式***中各计算服务器分别获取分片后的数据,有助于提高数据核对效率。
于本实施例中,采用哈希一致性分片规则对所述用户数据进行分片得到至少一个用户分片数据,将所述用户分片数据录入预设的用户记录表中,及采用哈希一致性分片规则对所述服务数据进行分片得到至少一个服务分片数据。
在一个可选的实施例中,请参阅图4,所述分片进程包括:
S41:获取用户数据的用户哈希表,及服务数据的服务哈希表;其中,所述用户哈希表反映了所述用户数据中各用户数据元素在分布式用户端中的保存位置,所述服务哈希表反映了所述服务数据中各服务数据元素在集中式服务器中的保存位置。
本步骤中,所述用户哈希表和服务哈希表,即:hashmap,是一种将用户数据以数组方式对数据进行存储的数据结构,每一个用户数据元素或服务数据元素将以key-value对的形 式作为一个entry保存在用户哈希表或服务哈希表中,而该entry则是所述哈希表中被视为最小整体的数据单元,其中,Entry是hashmap中保存一个键值对的单元模块。
S42:识别所述用户哈希表中哈希码对应的哈希桶,提取所述哈希桶中的用户数据元素并汇总得到用户分片数据;及识别所述服务哈希表中哈希码对应的哈希桶,提取所述哈希桶中的服务数据元素并汇总,得到服务分片数据。
本步骤,采用hashmap中的get函数获取用户哈希表及服务哈希表中的哈希码hashcode,其中,hashcode是保存用户数据元素及服务数据元素的哈希桶编号。汇总保存在同一哈希桶中的用户数据元素形成用户分片数据,及汇总保存在同一哈希桶中的服务数据元素形成服务分片数据,使得用户分片数据与服务分片数据可以根据哈希码相互对应,以便于通过并行执行核对进程,对同一哈希码的用户分片数据和服务分片数据进行比对,以便于提高数据核对效率。
S205:将所述用户分片数据录入预设的用户记录表中,并在所述用户记录表中的用户分片数据上载入用户状态标签;及将所述服务分片数据录入预设的服务记录表中,并在所述服务记录表中的服务分片数据上载入服务状态标签。
为避免分布式***重复调用已核对的用户分片数据和服务分片数据,导致数据核对作业效率低下的问题,本步骤通过设置用户记录表和服务记录表,并载入所述用户分片数据和服务分片数据的状态标签,所述状态标签可包括:已核对,未核对,核对中,以明晰各分片数据的当前状态,进而避免分布式***获取已核对和核对中的用户分片数据和服务分片数据,提高了数据核对作业的执行效率。
S206:调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据。
本步骤通过分布式***执行并行进程,以获取值相同的用户哈希码和服务哈希码,获得分别与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据,以提高所述用户目标数据和用户服务数据的识别效率。
在一个可选的实施例中,请参阅图5,所述并行进程包括:
S61:调用所述分布式***中的计算服务器,识别内容为待核对的用户状态标签并获取与所述用户状态标签对应的用户分片数据,及识别内容为待核对的服务状态标签并获取与所述服务状态标签对应的服务分片数据。
S62:识别所述用户分片数据和服务分片数据中值相同的用户哈希码和服务哈希码,将分别与所述用户哈希码和服务哈希码对应的用户分片数据和服务分片数据,设为用户目标数据和服务目标数据;
S63:将由所述计算机服务器获取的用户分片数据的用户状态标签修改为核对中,及将由所述计算机服务器获取的服务分片数据的服务状态标签修改为核对中,以避免分布式***其它计算服务器获取所述用户分片数据和服务分片数据。
本步骤中,所述用户状态标签和服务状态标签是可编辑的,对于被计算机服务器获取的用户分片数据和服务分片数据,编辑其用户状态标签和服务状态标签的内容,使其均由“待核对”改为“核对中。”
S207:执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
本步骤通过核对进程对用户目标数据和服务目标数据的异常进行识别,以识别出其中的异常数据,实现提高数据核对效率的技术效果。
在一个可选的实施例中,请参阅图6,所述核对进程包括:
S71:从所述用户目标数据和服务目标数据中提取值一致的用户键值和服务键值,判断所述用户键值对应的目标文件与所述服务键值对应的目标文件是否一致;
S72:若是,则判定所述用户键值及其目标文件与所述服务键值及其目标文件一致,并 将所述用户键值对应的用户分片数据的用户状态标签修改为已核对,及将由所述服务键值对应的服务分片数据的服务状态标签修改为已核对。
S73:若否,则判定所述用户键值及其目标文件,与所述服务键值及其目标文件为非匹配数据。
S74:从所述用户目标数据中提取所述服务目标数据中不存在的用户键值,并将所述用户键值及其目标文件设为用户单边数据。
S75:从所述服务目标数据中提取所述用户目标数据中不存在的服务键值,并将所述服务键值及其目标文件设为服务单边数据。
例如:用户目标数据包括“数据A,数据B和数据C”,而服务目标数据包括“数据A、数据B和数据D”。那么,对于S74,由于“数据C”是存在于用户目标数据而不存在于服务目标数据的,因此,“数据C”则是用户单边数据。对于S75,由于“数据D”是存在于服务目标数据中而不存在与用户目标数据中的,因此“数据D”则是服务单边数据。
S76:汇总所述非匹配数据、用户单边数据和服务单边数据得到异常数据。
具体地,构建用于存放所述非匹配数据的第一异常哈希表,构建用户存放所述用户单边数据的第二异常哈希表,删除服务单边数据中的服务键值,并构建用于存放所述服务单边数据的第三异常哈希表,汇总所述第一异常哈希表、第二异常哈希表和第三异常哈希表得到异常数据,并将该异常数据保存至异常数据库。
本实施例中,通过hashmap算法对所述非匹配数据、用户单边数据和服务单边数据进行hash处理,得到异常哈希表。由于hashmap算法和hash处理属于现有技术,而本申请所要解决的技术问题是如何识别异常数据并对其进行存放,因此,hashmap算法和hash处理的技术原理在此不做赘述。
可选的,汇总所述非匹配数据、用户单边数据和服务单边数据得到异常数据之后,还包括:
将所述异常数据上传至区块链中。
需要说明的是,基于异常数据得到对应的摘要信息,具体来说,摘要信息由异常数据进行散列处理得到,比如利用sha256s算法处理得到。将摘要信息上传至区块链可保证其安全性和对用户的公正透明性。用户设备可以从区块链中下载得该摘要信息,以便查证异常数据是否被篡改。本示例所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
在一个可选的实施例中,请参阅图7,判断所述用户键值对应的目标文件与所述服务键值对应的目标文件是否一致的步骤,包括:
S71-1:通过预设的第一哈希算法计算所述用户键值和服务键值,得到用户哈希码和服务哈希码。
本步骤中,所述用户哈希码是通过hashmap方法中的第一哈希算法将获得的数据的用户键值key进行hash运算后得到的哈希码hashcode;所述服务哈希码是通过hashmap方法中的第一哈希算法将获得的服务键值key进行hash运算后得到的哈希码hashcode。
S71-2:判断所述用户哈希码和服务哈希码是否一致。
S71-3:若所述用户哈希码和服务哈希码一致,则通过预设的第二哈希算法计算所述用户哈希码及所述用户键值的目标文件长度,得到能够反映所述用户键值对应目标文件的存储位置的用户位置码;以及通过所述第二哈希算法计算所述服务哈希码及所述服务键值的目标文件长度,得到能够反映所述服务键值对应目标文件的存储位置的服务位置码,得到所述用户位置码和服务位置码后执行S71-5。
本步骤中,所述用户位置码是通过hashmap的第二哈希算法,对所述用户哈希码 hashcode以及所述用户键值key对应的目标文件value的长度进行哈希运算得到数组下标;所述服务位置码是通过hashmap的第二哈希算法,对所述服务哈希码hashcode以及所述服务键值key对应的目标文件value的长度进行哈希运算得到数组下标。
S71-4:若所述用户哈希码和服务哈希码不一致,则判定所述用户键值和服务键值的目标文件不一致。
S71-5:根据得到的用户位置码和服务位置码,判断所述用户位置码和服务位置码是否一致。
S71-6:若所述用户位置码和服务位置码一致,则判定所述述用户键值和服务键值的目标文件一致;
并将所述用户键值对应的用户分片数据的用户状态标签修改为已核对,及将由所述服务键值对应的服务分片数据的服务状态标签修改为已核对,以避免分布式***中其它计算服务器获取所述用户分片数据和服务分片数据。
本步骤中,所述用户状态标签和服务状态标签是可编辑的,对于被计算机服务器获取的用户分片数据和服务分片数据,编辑其用户状态标签和服务状态标签的内容,使其均由“核对中”改为“已核对。”
S71-7:若所述用户位置码和服务位置码不一致,则判定所述用户键值和服务键值的目标文件不一致。
本步骤通过将用户分片数据和服务分片数据中的key,得到用户哈希码和服务哈希码,并对其进行比对,再根据用户哈希码和服务哈希码得到用户位置码和服务位置码,并对其进行比对,使核对进程无需对用户分片数据和服务分片数据进行逐一比对,即可准确的获得核对结果,提高了数据核对效率。
S208:将异常数据保存在预设的异常数据表中。
为便于数据控制者得到异常数据并对异常情况进行处理,本步骤将所述异常数据保存在异常数据表中,具体地,将所述第一异常哈希表、第二异常哈希表和第三异常哈希表发送预设的异常数据库中保存。
实施例三:
请参阅图8,本实施例的一种数据分片校验装置1,包括:
数据获取模块11,用于获取分布式用户端的用户数据,及集中式服务器的服务数据;
分片业务模块14,用于执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元;
目标识别模块16,用于调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;
核对业务模块17,用于执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
可选的,所述数据分片校验装置1还包括:
用户验证模块12,用于验证所述用户数据中的用户键值是否具有与其对应的目标文件;若是,则保留所述用户键值;若否,则判定所述用户键值为用户无效键值并将其保存在预设的异常数据库中,及将所述用户无效键值从所述用户数据中删除。
可选的,所述数据分片校验装置1还包括:
服务验证模块13,用于验证所述服务数据中的服务键值是否具有与其对应的目标文件;若是,则保留所述服务键值;若否,则判定所述服务键值为服务无效键值并将其保存在预设的异常数据库中,及将所述服务无效键值从所述服务数据中删除。
可选的,所述数据分片校验装置1还包括:
状态标签模块15,用于将所述用户分片数据录入预设的用户记录表中,并在所述用户记录表中的用户分片数据上载入用户状态标签;及将所述服务分片数据录入预设的服务记录表中,并在所述服务记录表中的服务分片数据上载入服务状态标签。
可选的,所述数据分片校验装置1还包括:
异常保存模块18,用于将异常数据保存在预设的异常数据表中。
本技术方案应用于云服务的云计算技术领域,通过对获取到的用户数据及服务数据执行分片进程,及调用至少包含有一个计算服务器的分布式***执行并行进程,以开展分布式***的集群计算,并获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据,最后执行核对进程识别异常数据。
实施例四:
为实现上述目的,本申请还提供一种计算机设备6,实施例三的数据分片校验装置1的组成部分可分散于不同的计算机设备中,计算机设备6可以是执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个应用服务器所组成的服务器集群)等。本实施例的计算机设备至少包括但不限于:可通过***总线相互通信连接的存储器61、处理器62,如图9所示。需要指出的是,图9仅示出了具有组件-的计算机设备,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
本实施例中,存储器61(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器61可以是计算机设备的内部存储单元,例如该计算机设备的硬盘或内存。在另一些实施例中,存储器61也可以是计算机设备的外部存储设备,例如该计算机设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器61还可以既包括计算机设备的内部存储单元也包括其外部存储设备。本实施例中,存储器61通常用于存储安装于计算机设备的操作***和各类应用软件,例如实施例三的数据分片校验装置的程序代码等。此外,存储器61还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器62在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器62通常用于控制计算机设备的总体操作。本实施例中,处理器62用于运行存储器61中存储的程序代码或者处理数据,例如运行数据分片校验装置,以实现实施例一和实施例二的数据分片校验方法。
实施例五:
为实现上述目的,本申请还提供一种计算机可读存储介质,本实施例中该计算机可读存储介质可以是易失性的,也可以是非易失性的。如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机程序,程序被处理器62执行时实现相应功能。本实施例的计算机可读存储介质用于存储数据分片校验装置,被处理器62执行时实现实施例一和实施例二的数据分片校验方法。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说 明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种数据分片校验方法,用于对分布式用户端和集中式服务器之间的同步数据进行校验,包括:
    获取分布式用户端的用户数据,及集中式服务器的服务数据;
    执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元;
    调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;
    执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
  2. 根据权利要求1所述的数据分片校验方法,其中,执行分片进程之前,包括:
    验证所述用户数据中的用户键值是否具有与其对应的目标文件;若是,则保留所述用户键值;若否,则判定所述用户键值为用户无效键值并将其保存在预设的异常数据库中,及将所述用户无效键值从所述用户数据中删除;
    验证所述服务数据中的服务键值是否具有与其对应的目标文件;若是,则保留所述服务键值;若否,则判定所述服务键值为服务无效键值并将其保存在预设的异常数据库中,及将所述服务无效键值从所述服务数据中删除。
  3. 根据权利要求1所述的数据分片校验方法,其中,所述分片进程包括:
    获取用户数据的用户哈希表,及服务数据的服务哈希表;其中,所述用户哈希表反映了所述用户数据中各用户数据元素在分布式用户端中的保存位置,所述服务哈希表反映了所述服务数据中各服务数据元素在集中式服务器中的保存位置;
    识别所述用户哈希表中哈希码对应的哈希桶,提取所述哈希桶中的用户数据元素并汇总,得到用户分片数据;及识别所述服务哈希表中哈希码对应的哈希桶,提取所述哈希桶中的服务数据元素并汇总得到服务分片数据。
  4. 根据权利要求1所述的数据分片校验方法,其中,执行分片进程之后,包括:
    将所述用户分片数据录入预设的用户记录表中,并在所述用户记录表中的用户分片数据上载入用户状态标签;及将所述服务分片数据录入预设的服务记录表中,并在所述服务记录表中的服务分片数据上载入服务状态标签。
  5. 根据权利要求1所述的数据分片校验方法,其中,所述并行进程包括:
    调用所述分布式***中的计算服务器,识别内容为待核对的用户状态标签并获取与所述用户状态标签对应的用户分片数据,及识别内容为待核对的服务状态标签并获取与所述服务状态标签对应的服务分片数据;
    识别所述用户分片数据和服务分片数据中值相同的用户哈希码和服务哈希码,将分别与所述用户哈希码和服务哈希码对应的用户分片数据和服务分片数据,设为用户目标数据和服务目标数据;
    将由所述计算机服务器获取的用户分片数据的用户状态标签修改为核对中,及将由所述计算机服务器获取的服务分片数据的服务状态标签修改为核对中,以避免分布式***其它计算服务器获取所述用户分片数据和服务分片数据。
  6. 根据权利要求1所述的数据分片校验方法,其中,所述核对进程包括:
    从所述用户目标数据和服务目标数据中提取值一致的用户键值和服务键值,判断所述用户键值对应的目标文件与所述服务键值对应的目标文件是否一致,若是,则判定所述用户键值及其目标文件与所述服务键值及其目标文件一致,并将所述用户键值对应的用户分 片数据的用户状态标签修改为已核对,及将由所述服务键值对应的服务分片数据的服务状态标签修改为已核对;若否,则判定所述用户键值及其目标文件,与所述服务键值及其目标文件为非匹配数据;
    从所述用户目标数据中提取所述服务目标数据中不存在的用户键值,并将所述用户键值及其目标文件设为用户单边数据;
    从所述服务目标数据中提取所述用户目标数据中不存在的服务键值,并将所述服务键值及其目标文件设为服务单边数据;
    汇总所述非匹配数据、用户单边数据和服务单边数据得到异常数据;
    汇总所述非匹配数据、用户单边数据和服务单边数据得到异常数据之后,还包括:
    将所述异常数据上传至区块链中。
  7. 根据权利要求1所述的数据分片校验方法,其中,判断所述用户键值对应的目标文件与所述服务键值对应的目标文件是否一致的步骤,包括:
    通过预设的第一哈希算法计算所述用户键值和服务键值,得到用户哈希码和服务哈希码;
    判断所述用户哈希码和服务哈希码是否一致;
    若所述用户哈希码和服务哈希码一致,则通过预设的第二哈希算法计算所述用户哈希码及所述用户键值的目标文件长度,得到能够反映所述用户键值对应目标文件的存储位置的用户位置码;以及通过所述第二哈希算法计算所述服务哈希码及所述服务键值的目标文件长度,得到能够反映所述服务键值对应目标文件的存储位置的服务位置码;
    若所述用户哈希码和服务哈希码不一致,则判定所述用户键值和服务键值的目标文件不一致;
    根据得到的用户位置码和服务位置码,判断所述用户位置码和服务位置码是否一致;
    若所述用户位置码和服务位置码一致,则判定所述述用户键值和服务键值的目标文件一致;
    若所述用户位置码和服务位置码不一致,则判定所述用户键值和服务键值的目标文件不一致。
  8. 一种数据分片校验装置,其中,包括:
    数据获取模块,用于获取分布式用户端的用户数据,及集中式服务器的服务数据;
    分片业务模块,用于执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元;
    目标识别模块,用于调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;
    核对业务模块,用于执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
  9. 一种计算机设备,其包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其中,所述计算机设备的处理器执行所述计算机程序时实现数据分片校验方法,所述数据分片校验方法包括:
    获取分布式用户端的用户数据,及集中式服务器的服务数据;
    执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元;
    调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;
    执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
  10. 根据权利要求9所述的计算机设备,其中,执行分片进程之前,包括:
    验证所述用户数据中的用户键值是否具有与其对应的目标文件;若是,则保留所述用户键值;若否,则判定所述用户键值为用户无效键值并将其保存在预设的异常数据库中,及将所述用户无效键值从所述用户数据中删除;
    验证所述服务数据中的服务键值是否具有与其对应的目标文件;若是,则保留所述服务键值;若否,则判定所述服务键值为服务无效键值并将其保存在预设的异常数据库中,及将所述服务无效键值从所述服务数据中删除。
  11. 根据权利要求9所述的计算机设备,其中,所述分片进程包括:
    获取用户数据的用户哈希表,及服务数据的服务哈希表;其中,所述用户哈希表反映了所述用户数据中各用户数据元素在分布式用户端中的保存位置,所述服务哈希表反映了所述服务数据中各服务数据元素在集中式服务器中的保存位置;
    识别所述用户哈希表中哈希码对应的哈希桶,提取所述哈希桶中的用户数据元素并汇总,得到用户分片数据;及识别所述服务哈希表中哈希码对应的哈希桶,提取所述哈希桶中的服务数据元素并汇总得到服务分片数据;
    执行分片进程之后,包括:
    将所述用户分片数据录入预设的用户记录表中,并在所述用户记录表中的用户分片数据上载入用户状态标签;及将所述服务分片数据录入预设的服务记录表中,并在所述服务记录表中的服务分片数据上载入服务状态标签。
  12. 根据权利要求9所述的计算机设备,其中,所述并行进程包括:
    调用所述分布式***中的计算服务器,识别内容为待核对的用户状态标签并获取与所述用户状态标签对应的用户分片数据,及识别内容为待核对的服务状态标签并获取与所述服务状态标签对应的服务分片数据;
    识别所述用户分片数据和服务分片数据中值相同的用户哈希码和服务哈希码,将分别与所述用户哈希码和服务哈希码对应的用户分片数据和服务分片数据,设为用户目标数据和服务目标数据;
    将由所述计算机服务器获取的用户分片数据的用户状态标签修改为核对中,及将由所述计算机服务器获取的服务分片数据的服务状态标签修改为核对中,以避免分布式***其它计算服务器获取所述用户分片数据和服务分片数据。
  13. 根据权利要求9所述的计算机设备,其中,所述核对进程包括:
    从所述用户目标数据和服务目标数据中提取值一致的用户键值和服务键值,判断所述用户键值对应的目标文件与所述服务键值对应的目标文件是否一致,若是,则判定所述用户键值及其目标文件与所述服务键值及其目标文件一致,并将所述用户键值对应的用户分片数据的用户状态标签修改为已核对,及将由所述服务键值对应的服务分片数据的服务状态标签修改为已核对;若否,则判定所述用户键值及其目标文件,与所述服务键值及其目标文件为非匹配数据;
    从所述用户目标数据中提取所述服务目标数据中不存在的用户键值,并将所述用户键值及其目标文件设为用户单边数据;
    从所述服务目标数据中提取所述用户目标数据中不存在的服务键值,并将所述服务键值及其目标文件设为服务单边数据;
    汇总所述非匹配数据、用户单边数据和服务单边数据得到异常数据;
    汇总所述非匹配数据、用户单边数据和服务单边数据得到异常数据之后,还包括:
    将所述异常数据上传至区块链中。
  14. 根据权利要求9所述的计算机设备,其中,判断所述用户键值对应的目标文件与所述服务键值对应的目标文件是否一致的步骤,包括:
    通过预设的第一哈希算法计算所述用户键值和服务键值,得到用户哈希码和服务哈希码;
    判断所述用户哈希码和服务哈希码是否一致;
    若所述用户哈希码和服务哈希码一致,则通过预设的第二哈希算法计算所述用户哈希码及所述用户键值的目标文件长度,得到能够反映所述用户键值对应目标文件的存储位置的用户位置码;以及通过所述第二哈希算法计算所述服务哈希码及所述服务键值的目标文件长度,得到能够反映所述服务键值对应目标文件的存储位置的服务位置码;
    若所述用户哈希码和服务哈希码不一致,则判定所述用户键值和服务键值的目标文件不一致;
    根据得到的用户位置码和服务位置码,判断所述用户位置码和服务位置码是否一致;
    若所述用户位置码和服务位置码一致,则判定所述述用户键值和服务键值的目标文件一致;
    若所述用户位置码和服务位置码不一致,则判定所述用户键值和服务键值的目标文件不一致。
  15. 一种计算机可读存储介质,所述可读存储介质上存储有计算机程序,其中,所述可读存储介质存储的所述计算机程序被处理器执行时实现数据分片校验方法,所述数据分片校验方法包括:
    获取分布式用户端的用户数据,及集中式服务器的服务数据;
    执行分片进程,以分别对所述用户数据和服务数据进行分片,汇总所述用户数据中包含有同一用户哈希码的用户数据元素得到用户分片数据,及汇总所述服务数据中包含有同一服务哈希码的服务数据元素得到服务分片数据;其中,所述用户数据元素是构成所述用户数据的最小单元,所述服务数据元素是构成所述服务数据的最小单元;
    调用至少包含有一个计算服务器的分布式***执行并行进程,以从用户分片数据和服务分片数据中,获取值相同的用户哈希码与服务哈希码,以及与所述用户哈希码和服务哈希码对应的用户目标数据和服务目标数据;
    执行核对进程,以对所述用户目标数据和服务目标数据进行校验以识别其中的异常数据。
  16. 根据权利要求15所述的计算机可读存储介质,其中,执行分片进程之前,包括:
    验证所述用户数据中的用户键值是否具有与其对应的目标文件;若是,则保留所述用户键值;若否,则判定所述用户键值为用户无效键值并将其保存在预设的异常数据库中,及将所述用户无效键值从所述用户数据中删除;
    验证所述服务数据中的服务键值是否具有与其对应的目标文件;若是,则保留所述服务键值;若否,则判定所述服务键值为服务无效键值并将其保存在预设的异常数据库中,及将所述服务无效键值从所述服务数据中删除。
  17. 根据权利要求15所述的计算机可读存储介质,其中,所述分片进程包括:
    获取用户数据的用户哈希表,及服务数据的服务哈希表;其中,所述用户哈希表反映了所述用户数据中各用户数据元素在分布式用户端中的保存位置,所述服务哈希表反映了所述服务数据中各服务数据元素在集中式服务器中的保存位置;
    识别所述用户哈希表中哈希码对应的哈希桶,提取所述哈希桶中的用户数据元素并汇总,得到用户分片数据;及识别所述服务哈希表中哈希码对应的哈希桶,提取所述哈希桶中的服务数据元素并汇总得到服务分片数据;
    执行分片进程之后,包括:
    将所述用户分片数据录入预设的用户记录表中,并在所述用户记录表中的用户分片数 据上载入用户状态标签;及将所述服务分片数据录入预设的服务记录表中,并在所述服务记录表中的服务分片数据上载入服务状态标签。
  18. 根据权利要求15所述的计算机可读存储介质,其中,所述并行进程包括:
    调用所述分布式***中的计算服务器,识别内容为待核对的用户状态标签并获取与所述用户状态标签对应的用户分片数据,及识别内容为待核对的服务状态标签并获取与所述服务状态标签对应的服务分片数据;
    识别所述用户分片数据和服务分片数据中值相同的用户哈希码和服务哈希码,将分别与所述用户哈希码和服务哈希码对应的用户分片数据和服务分片数据,设为用户目标数据和服务目标数据;
    将由所述计算机服务器获取的用户分片数据的用户状态标签修改为核对中,及将由所述计算机服务器获取的服务分片数据的服务状态标签修改为核对中,以避免分布式***其它计算服务器获取所述用户分片数据和服务分片数据。
  19. 根据权利要求15所述的计算机可读存储介质,其中,所述核对进程包括:
    从所述用户目标数据和服务目标数据中提取值一致的用户键值和服务键值,判断所述用户键值对应的目标文件与所述服务键值对应的目标文件是否一致,若是,则判定所述用户键值及其目标文件与所述服务键值及其目标文件一致,并将所述用户键值对应的用户分片数据的用户状态标签修改为已核对,及将由所述服务键值对应的服务分片数据的服务状态标签修改为已核对;若否,则判定所述用户键值及其目标文件,与所述服务键值及其目标文件为非匹配数据;
    从所述用户目标数据中提取所述服务目标数据中不存在的用户键值,并将所述用户键值及其目标文件设为用户单边数据;
    从所述服务目标数据中提取所述用户目标数据中不存在的服务键值,并将所述服务键值及其目标文件设为服务单边数据;
    汇总所述非匹配数据、用户单边数据和服务单边数据得到异常数据;
    汇总所述非匹配数据、用户单边数据和服务单边数据得到异常数据之后,还包括:
    将所述异常数据上传至区块链中。
  20. 根据权利要求15所述的计算机可读存储介质,其中,判断所述用户键值对应的目标文件与所述服务键值对应的目标文件是否一致的步骤,包括:
    通过预设的第一哈希算法计算所述用户键值和服务键值,得到用户哈希码和服务哈希码;
    判断所述用户哈希码和服务哈希码是否一致;
    若所述用户哈希码和服务哈希码一致,则通过预设的第二哈希算法计算所述用户哈希码及所述用户键值的目标文件长度,得到能够反映所述用户键值对应目标文件的存储位置的用户位置码;以及通过所述第二哈希算法计算所述服务哈希码及所述服务键值的目标文件长度,得到能够反映所述服务键值对应目标文件的存储位置的服务位置码;
    若所述用户哈希码和服务哈希码不一致,则判定所述用户键值和服务键值的目标文件不一致;
    根据得到的用户位置码和服务位置码,判断所述用户位置码和服务位置码是否一致;
    若所述用户位置码和服务位置码一致,则判定所述述用户键值和服务键值的目标文件一致;
    若所述用户位置码和服务位置码不一致,则判定所述用户键值和服务键值的目标文件不一致。
PCT/CN2020/125114 2020-09-02 2020-10-30 数据分片校验方法、装置、计算机设备及可读存储介质 WO2021174882A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010908571.0A CN112052141B (zh) 2020-09-02 2020-09-02 数据分片校验方法、装置、计算机设备及可读存储介质
CN202010908571.0 2020-09-02

Publications (1)

Publication Number Publication Date
WO2021174882A1 true WO2021174882A1 (zh) 2021-09-10

Family

ID=73608215

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/125114 WO2021174882A1 (zh) 2020-09-02 2020-10-30 数据分片校验方法、装置、计算机设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN112052141B (zh)
WO (1) WO2021174882A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114205139A (zh) * 2021-12-09 2022-03-18 中国电信股份有限公司 算力资源管理方法、节点、***和存储介质
CN116094844A (zh) * 2023-04-10 2023-05-09 蓝象智联(杭州)科技有限公司 一种用于多方安全计算的地址核对方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010142111A1 (zh) * 2009-06-09 2010-12-16 中兴通讯股份有限公司 一种分布式文件***中校验和同步数据块的方法及装置
CN102638578A (zh) * 2012-03-29 2012-08-15 深圳市高正软件有限公司 一种基于移动设备的数据同步方法及***
CN104780211A (zh) * 2015-04-13 2015-07-15 努比亚技术有限公司 数据同步方法和装置
CN110413441A (zh) * 2019-06-18 2019-11-05 平安科技(深圳)有限公司 主备存储卷同步数据校验方法、装置、设备及存储介质
CN111506578A (zh) * 2020-04-17 2020-08-07 深圳前海微众银行股份有限公司 业务数据的校验方法、装置、设备及存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107154945A (zh) * 2017-05-31 2017-09-12 中南大学 一种基于纠删码的多云碎片化安全存储方法及***
US10877962B2 (en) * 2017-08-11 2020-12-29 International Business Machines Corporation Deferred update of database hashcode in blockchain
CN109492436A (zh) * 2018-11-29 2019-03-19 深圳市网心科技有限公司 一种文件校验方法及相关装置
CN109816481A (zh) * 2019-01-04 2019-05-28 平安科技(深圳)有限公司 账单处理方法、装置及计算机可读存储介质
CN110149373B (zh) * 2019-04-28 2022-01-07 平安科技(深圳)有限公司 基于点对点网络的数据存储方法、装置、介质及服务器
CN110300173A (zh) * 2019-06-28 2019-10-01 杭州复杂美科技有限公司 去中心化数据存储方法、验证方法、设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010142111A1 (zh) * 2009-06-09 2010-12-16 中兴通讯股份有限公司 一种分布式文件***中校验和同步数据块的方法及装置
CN102638578A (zh) * 2012-03-29 2012-08-15 深圳市高正软件有限公司 一种基于移动设备的数据同步方法及***
CN104780211A (zh) * 2015-04-13 2015-07-15 努比亚技术有限公司 数据同步方法和装置
CN110413441A (zh) * 2019-06-18 2019-11-05 平安科技(深圳)有限公司 主备存储卷同步数据校验方法、装置、设备及存储介质
CN111506578A (zh) * 2020-04-17 2020-08-07 深圳前海微众银行股份有限公司 业务数据的校验方法、装置、设备及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114205139A (zh) * 2021-12-09 2022-03-18 中国电信股份有限公司 算力资源管理方法、节点、***和存储介质
CN116094844A (zh) * 2023-04-10 2023-05-09 蓝象智联(杭州)科技有限公司 一种用于多方安全计算的地址核对方法

Also Published As

Publication number Publication date
CN112052141A (zh) 2020-12-08
CN112052141B (zh) 2022-04-01

Similar Documents

Publication Publication Date Title
EP3776208B1 (en) Runtime self-correction for blockchain ledgers
CN109831487B (zh) 分片文件验证方法及终端设备
US11671262B2 (en) Asynchronously determining relational data integrity using cryptographic data structures
CN108494557B (zh) 社保数字证书管理方法、计算机可读存储介质及终端设备
US11593029B1 (en) Identifying a parent event associated with child error states
US11243839B1 (en) Audit file generation in a dispersed storage network
WO2020224235A1 (zh) 跨链交易的方法、装置、设备及存储介质
WO2021174882A1 (zh) 数据分片校验方法、装置、计算机设备及可读存储介质
WO2020224100A1 (zh) 区块链配置文件的处理装置、***、方法及存储介质
US20200021602A1 (en) Trace-based transaction validation and commitment
US20180121669A1 (en) Extended security scrutiny of data access requests in a dispersed storage network
CN112511316A (zh) 单点登录接入方法、装置、计算机设备及可读存储介质
WO2019061667A1 (zh) 电子装置、数据处理方法、***及计算机可读存储介质
WO2021012732A1 (zh) 基于区块链的信息验证装置、方法及存储介质
CN111722946A (zh) 分布式事务处理方法、装置、计算机设备及可读存储介质
CN113420050A (zh) 数据查询管理方法、装置、计算机设备及可读存储介质
CN111698227B (zh) 信息同步管理方法、装置、计算机***及可读存储介质
CN116136844A (zh) 实体标识信息的生成方法、装置、介质及电子设备
CN114386047A (zh) 应用漏洞检测方法、装置、电子设备及存储介质
CN115630409B (zh) 一种数据的存储控制方法及装置
CN113434505B (zh) 交易信息属性检索方法、装置、计算机设备及存储介质
CN112019350B (zh) 区块链的区块验证方法及装置
CN114650252B (zh) 基于企业服务总线的路由方法、装置及计算机设备
US20240154945A1 (en) System and method for third party service integration into a browser client application
CN114238270A (zh) 数据库操作方法、装置、计算机设备及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20923295

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20923295

Country of ref document: EP

Kind code of ref document: A1