Method and apparatus for consistency checking of wellbore data

By converting, segmenting, and generating a verification string using the MD5 checksum algorithm for wellbore data, the consistency problem of wellbore data during transmission is solved, ensuring data integrity and accuracy.

CN114493469BActive Publication Date: 2026-01-27PETROCHINA CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011255557.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-11
Publication Date
2026-01-27
Estimated Expiration
2040-11-11

AI Technical Summary

Technical Problem

During oil and gas exploration and development, wellbore-related data is easily damaged during the process from acquisition to transmission to the target database, leading to data inconsistency issues.

Method used

The MD5 checksum algorithm is used to verify the consistency of wellbore data. By converting, segmenting and performing secondary conversion on the data, a checksum string is generated and transmitted along with the data during transmission so that the receiving end can verify it.

Benefits of technology

It ensures data consistency and accuracy during wellbore data transmission, guarantees data integrity, and prevents tampering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114493469B_ABST
    Figure CN114493469B_ABST
Patent Text Reader

Abstract

The present disclosure provides a wellbore data consistency checking method and device, belonging to the technical field of oil and gas exploration and development. The wellbore data is converted, segmented, twice converted, and based on the converted array and MD5 algorithm, a check string is obtained, so that the check string is transmitted at the same time as the wellbore data is transmitted, so that the data receiving end can check the wellbore data based on the check string, thereby realizing the checking of data consistency and ensuring the data consistency of the wellbore data in the transmission process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of oil and gas exploration and development technology, and in particular to a method and apparatus for verifying the consistency of wellbore data. Background Technology

[0002] Before 2004, geological data from single wells in the petroleum industry were mainly stored on paper. Starting in 2004, with the development of computer technology, single-well geological data gradually began to be managed digitally. By 2014, the informatization of wellbore-related data, including drilling, logging, well logging, downhole operations, and analytical testing, was basically completed. However, single-well operations are mostly conducted in the field, and data is easily damaged during the process from acquisition to transmission to the target database. Therefore, there is an urgent need for a verification method to ensure data consistency during data transmission. Summary of the Invention

[0003] This disclosure provides a method and apparatus for verifying the consistency of wellbore data, which can provide a method to ensure data consistency during data transmission. The technical solution is as follows:

[0004] On the one hand, a consistency verification method for wellbore data is provided, applied to a first electronic device in a wellbore data acquisition system, the method comprising:

[0005] Obtain the form to be transmitted, the form containing wellbore data;

[0006] The form is transformed to obtain a first array A, where the first array represents the form as a character array;

[0007] The first array A is divided into multiple data segments;

[0008] Each of the multiple data fragments is converted to a Ulong type to obtain the second array B;

[0009] Obtain the first parameters SA1, SA2, SA3, and SA4;

[0010] The first parameters SA1, SA2, SA3 and SA4 and the second array B are used as inputs to the MD5 checksum algorithm to obtain the second parameters SA1', SA2', SA3' and SA4'.

[0011] Based on the second parameters SA1', SA2', SA3', and SA4', generate the verification string S;

[0012] The verification string S and the form are transmitted together to the second electronic device, whereby the verification string S is used by the second electronic device to verify the form.

[0013] In one possible implementation, the step of transforming the content of the form to obtain the first array A includes:

[0014] Obtain the form content from the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain the first array A.

[0015] In one possible implementation, dividing the first array A into multiple data segments includes:

[0016] Get the length of the first array A;

[0017] Divide the length by a constant 64 to obtain the number of blocks. Divide the first array A into multiple data segments according to the number of blocks.

[0018] In one possible implementation, obtaining the first parameters SA1, SA2, SA3, and SA4 includes:

[0019] Get the hexadecimal variables S1, S2, S3, and S4;

[0020] Four hexadecimal constants are assigned to the hexadecimal variables S1, S2, S3, and S4 to obtain the first parameters SA1, SA2, SA3, and SA4.

[0021] On the one hand, a consistency verification method for wellbore data is provided, applied to a second electronic device in a wellbore data acquisition system, the method comprising:

[0022] Receive a form and a verification string S from the first electronic device in the wellbore data acquisition system;

[0023] The form is transformed to obtain a first array A, where the first array represents the form as a character array;

[0024] The first array A is divided into multiple data segments;

[0025] Each of the multiple data fragments is converted to a Ulong type to obtain the second array B;

[0026] Obtain the first parameters SA1, SA2, SA3, and SA4;

[0027] The first parameters SA1, SA2, SA3 and SA4 and the second array B are used as inputs to the MD5 checksum algorithm to obtain the second parameters SA1', SA2', SA3' and SA4'.

[0028] Based on the second parameters SA1', SA2', SA3' and SA4', generate the verification string S';

[0029] Compare the verification strings S and S';

[0030] If the verification strings S and S' are consistent, the form verification passes.

[0031] In one possible implementation, the step of transforming the content of the form to obtain the first array A includes:

[0032] Obtain the form content from the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain the first array A.

[0033] In one possible implementation, dividing the first array A into multiple data segments includes:

[0034] Get the length of the first array A;

[0035] Divide the length by a constant 64 to obtain the number of blocks. Divide the first array A into multiple data segments according to the number of blocks.

[0036] In one possible implementation, obtaining the first parameters SA1, SA2, SA3, and SA4 includes:

[0037] Get the hexadecimal variables S1, S2, S3, and S4;

[0038] Four hexadecimal constants are assigned to the hexadecimal variables S1, S2, S3, and S4 to obtain the first parameters SA1, SA2, SA3, and SA4.

[0039] On the one hand, a wellbore data consistency verification device is provided, applied to a first electronic device in a wellbore data acquisition system, the device comprising:

[0040] The acquisition module is used to acquire the form to be transmitted, which contains wellbore data;

[0041] The first conversion module is used to convert the content of the form to obtain a first array A, wherein the first array is the form represented by a character array;

[0042] The segmentation module is used to divide the first array A into multiple data segments;

[0043] The second conversion module is used to convert the multiple data fragments into Ulong type respectively to obtain the second array B;

[0044] The first parameter acquisition module is used to acquire the first parameters SA1, SA2, SA3 and SA4;

[0045] The second parameter acquisition module is used to take the first parameters SA1, SA2, SA3 and SA4 and the second array B as inputs to the MD5 checksum algorithm to obtain the second parameters SA1', SA2', SA3' and SA4'.

[0046] The string generation module is used to generate a verification string S based on the second parameters SA1', SA2', SA3', and SA4'.

[0047] The sending module is used to transmit the verification string S and the form together to the second electronic device, wherein the verification string S is used by the second electronic device to verify the form.

[0048] In one possible implementation, the first conversion module is used to obtain the form content in the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain the first array A.

[0049] In one possible implementation, the segmentation module is used to obtain the length of the first array A; divide the length by a constant 64 to obtain the number of blocks; and divide the first array A according to the number of blocks to obtain multiple data segments.

[0050] In one possible implementation, the first parameter acquisition module is used to acquire hexadecimal variables S1, S2, S3 and S4; and to assign four hexadecimal constants to the hexadecimal variables S1, S2, S3 and S4 to obtain the first parameters SA1, SA2, SA3 and SA4.

[0051] On the one hand, a wellbore data consistency verification device is provided, which is applied to a second electronic device in a wellbore data acquisition system. The device includes:

[0052] The receiving module is used to receive the form and verification string S from the first electronic device in the wellbore data acquisition system;

[0053] The first conversion module is used to convert the content of the form to obtain a first array A, wherein the first array is the form represented by a character array;

[0054] The segmentation module is used to divide the first array A into multiple data segments;

[0055] The second conversion module is used to convert the multiple data fragments into Ulong type respectively to obtain the second array B;

[0056] The first parameter acquisition module is used to acquire the first parameters SA1, SA2, SA3 and SA4;

[0057] The second parameter acquisition module is used to take the first parameters SA1, SA2, SA3 and SA4 and the second array B as inputs to the MD5 checksum algorithm to obtain the second parameters SA1', SA2', SA3' and SA4'.

[0058] The string generation module is used to generate a verification string S' based on the second parameters SA1', SA2', SA3', and SA4'.

[0059] The comparison module is used to compare the verification strings S and S'; if the verification strings S and S' are consistent, the form verification passes.

[0060] In one possible implementation, the first conversion module is used to obtain the form content in the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain the first array A.

[0061] In one possible implementation, the segmentation module is used to obtain the length of the first array A; divide the length by a constant 64 to obtain the number of blocks; and divide the first array A according to the number of blocks to obtain multiple data segments.

[0062] In one possible implementation, the first parameter acquisition module is used to acquire hexadecimal variables S1, S2, S3 and S4; and to assign four hexadecimal constants to the hexadecimal variables S1, S2, S3 and S4 to obtain the first parameters SA1, SA2, SA3 and SA4.

[0063] On one hand, a computer device is provided, the computer device including one or more processors and one or more memories, the one or more memories storing at least one piece of program code, the program code being loaded and executed by the one or more processors to implement the wellbore data consistency verification method.

[0064] On one hand, a computer-readable storage medium is provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the program code being loaded and executed by a processor to implement the wellbore data consistency verification method.

[0065] On one hand, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the wellbore data consistency verification method provided in various optional implementations of any of the above aspects. Attached Figure Description

[0066] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0067] Figure 1 This is a flowchart of a wellbore data consistency verification method provided in an embodiment of this disclosure;

[0068] Figure 2 This is a flowchart of a wellbore data consistency verification method provided in an embodiment of this disclosure;

[0069] Figure 3 This is a flowchart of a wellbore data consistency verification method provided in an embodiment of this disclosure;

[0070] Figure 4 This is a flowchart of a wellbore data consistency verification method provided in an embodiment of this disclosure;

[0071] Figure 5 This is a schematic diagram of the structure of a wellbore data consistency verification device provided in an embodiment of this disclosure;

[0072] Figure 6 This is a schematic diagram of the structure of a wellbore data consistency verification device provided in an embodiment of this disclosure;

[0073] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0074] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.

[0075] Figure 1 This is a flowchart of a wellbore data consistency verification method provided in this embodiment of the disclosure. See also: Figure 1 The consistency verification method for this wellbore data includes:

[0076] 101. Obtain the form to be transmitted, the form containing wellbore data.

[0077] Wellbore data refers to wellbore-related data, such as drilling, logging, well logging, downhole operations, analysis and testing data, etc., which are not limited in this application embodiment.

[0078] 102. Perform content conversion on the form to obtain a first array A, wherein the first array is the form represented by a character array.

[0079] 103. Divide the first array A into multiple data segments.

[0080] 104. Convert the multiple data fragments into Ulong type respectively to obtain the second array B.

[0081] 105. Obtain the first parameters SA1, SA2, SA3 and SA4.

[0082] 106. Using the first parameters SA1, SA2, SA3 and SA4 and the second array B as inputs to the MD5 checksum algorithm, the second parameters SA1', SA2', SA3' and SA4' are obtained.

[0083] 107. Generate a verification string S based on the second parameters SA1', SA2', SA3', and SA4'.

[0084] 108. The verification string S and the form are transmitted together to the second electronic device, wherein the verification string S is used by the second electronic device to verify the form.

[0085] The method provided in this application embodiment converts, segments, and performs secondary conversion on wellbore data, and obtains a check string based on the converted array and MD5 algorithm. This allows the check string to be transmitted simultaneously with the wellbore data, enabling the data receiving end to verify the wellbore data based on the check string. This achieves data consistency verification and ensures the consistency of wellbore data during transmission.

[0086] In one possible implementation, the step of converting the content of the form to obtain the first array A includes: obtaining the form content in the form, adding a first character to every two fields in the form content, and adding a second character between every two lines in the form content to obtain the first array A.

[0087] In one possible implementation, dividing the first array A into multiple data segments includes: obtaining the length of the first array A; dividing the length by a constant 64 to obtain the number of blocks; and dividing the first array A into multiple data segments according to the number of blocks.

[0088] In one possible implementation, obtaining the first parameters SA1, SA2, SA3, and SA4 includes: obtaining hexadecimal variables S1, S2, S3, and S4; and assigning four hexadecimal constants to the hexadecimal variables S1, S2, S3, and S4 to obtain the first parameters SA1, SA2, SA3, and SA4.

[0089] All of the above-mentioned optional technical solutions can be combined in any way to form optional embodiments of this disclosure, and will not be described in detail here.

[0090] Figure 2 This is a flowchart of a wellbore data consistency verification method provided in this embodiment of the disclosure. See also: Figure 2 The consistency verification method for this wellbore data includes:

[0091] 201. The first electronic device acquires a form to be transmitted, which contains wellbore data.

[0092] The first electronic device can be a wellbore data acquisition device, used to acquire wellbore data and generate a form based on the acquired wellbore data. The form can be in any format; for example, it can be a two-dimensional form.

[0093] 202. Perform content conversion on the form to obtain a first array A, wherein the first array is the form represented by a character array.

[0094] The first electronic device acquires the form content from the form, adds a first character between every two fields in the form content, and adds a second character between every two lines in the form content to obtain the first array A. When the form is a two-dimensional form, each line of the form includes multiple fields. Therefore, "\t" can be added between every two fields, and "\r" and "\n" can be added between every two lines to separate the fields and the lines, thus converting the two-dimensional form into a one-dimensional first array. Other symbols can also be used to separate fields and lines; this application embodiment does not limit this method.

[0095] 203. The first electronic device obtains the length of the first array A; divides the length by a constant 64 to obtain the number of blocks; and divides the first array A according to the number of blocks to obtain multiple data segments.

[0096] By dividing the length by a constant 64, the first array can be divided into multiple 64-bit data segments, ensuring that subsequent array transformations can be performed based on data segments of the same length. Of course, if the length of the first array exceeds the target length, when dividing based on the number of blocks, every 2N (where N is an integer greater than or equal to 1) 64-bit data segments can be divided into a single data fragment. That is, the division method can be adjusted according to the actual length of the first data segment, using 64 bits as the base fragment length, so that regardless of the division method, the number of data fragments obtained is the same, thus ensuring that the number of elements in the resulting second array is the same during subsequent processing.

[0097] 204. The first electronic device converts the multiple data fragments into Ulong type respectively to obtain the second array B.

[0098] Among them, Ulong (unsigned long integer) refers to storing characters as a 32-bit (4-byte) numerical form.

[0099] 205. The first electronic device acquires hexadecimal variables S1, S2, S3 and S4; sets four hexadecimal constants and assigns them to the hexadecimal variables S1, S2, S3 and S4 to obtain the first parameters SA1, SA2, SA3 and SA4.

[0100] Step 205 above describes the process by which the first electronic device acquires the first parameters SA1, SA2, SA3, and SA4. These four variables can be arbitrary, and this application does not impose any restrictions on them. The first electronic device can randomly generate four hexadecimal constants to assign values ​​to the above variables.

[0101] In some embodiments, the first electronic device can generate a corresponding hexadecimal constant based on its device information, such as device type and device identifier, so that when the data receiving end performs verification, it can ensure the legitimacy of the data sending device and avoid problems such as data tampering.

[0102] 206. The first electronic device uses the first parameters SA1, SA2, SA3 and SA4 and the second array B as inputs to the MD5 checksum algorithm to obtain the second parameters SA1', SA2', SA3' and SA4'.

[0103] After generating the first parameter, the first electronic device can input the generated first parameter and the second array B into the MD5 checksum generator. The generator uses the MD5 checksum algorithm to process the input data and obtain the second parameter.

[0104] In some embodiments, the first electronic device concatenates the first parameters SA1, SA2, SA3 and SA4 to the second array B to obtain the corresponding first intermediate parameters, and then inputs the multiple first intermediate parameters obtained by concatenation into the MD5 checksum generator to obtain the corresponding second parameters SA1', SA2', SA3' and SA4'.

[0105] In some embodiments, the first electronic device splits the second array B into four data segments, concatenates each data segment with the first parameters SA1, SA2, SA3 and SA4 respectively to obtain the corresponding second intermediate parameters, and then inputs the concatenated second intermediate parameters into an MD5 checksum generator to obtain the corresponding second parameters SA1', SA2', SA3' and SA4'.

[0106] The two processing methods described above are merely examples of generating the second parameter based on the first parameters SA1, SA2, SA3, and SA4 and the second array B. In other embodiments, the second parameter can also be generated based on the transformation of the second array and the multiple first parameters. This application does not limit this approach.

[0107] 207. The first electronic device generates a verification string S based on the second parameters SA1', SA2', SA3' and SA4'.

[0108] In the embodiments of this application, the above-mentioned verification string can be generated by concatenating multiple second parameters. In some embodiments, the first electronic device can concatenate the above-mentioned multiple second parameters in a preset order, for example, concatenating them in ascending order of parameter number or in descending order of parameter number, which is not limited here.

[0109] Of course, in some embodiments, the verification string can also be obtained based on the string obtained by concatenating multiple second parameters. For example, the first electronic device extracts the first preset number of characters from the string obtained after concatenation as the verification string to increase the complexity of subsequent verification and thus improve data security.

[0110] 208. The first electronic device transmits the verification string S and the form together to the second electronic device, whereby the verification string S is used by the second electronic device to verify the form.

[0111] After generating the verification string, the first electronic device can package the verification string and the form into a data packet and send it to the second electronic device. For example, the first electronic device can package the verification string in a designated location in the data packet, where the designated location is used to store the verification string to be verified by the data receiving end. Alternatively, the first electronic device can add the verification string to the form and then package the added form for transmission. This application embodiment does not limit the method used for packaging.

[0112] The method provided in this application embodiment converts, segments, and performs secondary conversion on wellbore data, and obtains a check string based on the converted array and MD5 algorithm. This allows the check string to be transmitted simultaneously with the wellbore data, enabling the data receiving end to verify the wellbore data based on the check string. This achieves data consistency verification, ensuring data consistency during transmission and guaranteeing data accuracy.

[0113] It should be noted that in the following embodiments, the names of the first array, the second array, and various parameters are the same as those used in the first electronic device in the above embodiments. This is only for the purpose of simplifying the terminology. For the second electronic device, the content of the form and the verification string it receives may change. That is, the received verification string may not be the string sent by the sending end, and the form may also change. Accordingly, the names of the first array, the second array, etc., are only used to represent the data obtained by the second electronic device after processing the received data, and are not necessarily the same as the data sent by the sending side.

[0114] Figure 3 This is a flowchart of a wellbore data consistency verification method provided in an embodiment of this disclosure. This method is applied to a second electronic device acting as a data receiver. See also... Figure 3 The consistency verification method for this wellbore data includes:

[0115] 301. Receive the form and verification string S from the first electronic device in the wellbore data acquisition system.

[0116] 302. Perform content conversion on the form to obtain a first array A, wherein the first array is the form represented by a character array.

[0117] 303. Divide the first array A into multiple data segments.

[0118] 304. Convert the multiple data fragments into Ulong type respectively to obtain the second array B.

[0119] 305. Obtain the first parameters SA1, SA2, SA3 and SA4.

[0120] 306. The first parameters SA1, SA2, SA3 and SA4 and the second array B are used as inputs to the MD5 checksum algorithm to obtain the second parameters SA1', SA2', SA3' and SA4'.

[0121] 307. Generate the verification string S' based on the second parameters SA1', SA2', SA3' and SA4'.

[0122] 308. Compare the verification strings S and S'.

[0123] 309. If the verification strings S and S' are consistent, the form verification passes.

[0124] In some embodiments, the step of performing content transformation on the form to obtain the first array A includes:

[0125] The first electronic device acquires the form content in the form, adds a first character to every two fields in the form content, and adds a second character between every two lines in the form content to obtain the first array A.

[0126] In some embodiments, dividing the first array A into multiple data segments includes:

[0127] Get the length of the first array A;

[0128] Divide the length by a constant 64 to obtain the number of blocks. Divide the first array A into multiple data segments according to the number of blocks.

[0129] In some embodiments, obtaining the first parameters SA1, SA2, SA3, and SA4 includes:

[0130] Get the hexadecimal variables S1, S2, S3, and S4;

[0131] Four hexadecimal constants are assigned to the hexadecimal variables S1, S2, S3, and S4 to obtain the first parameters SA1, SA2, SA3, and SA4.

[0132] Figure 4 This is a flowchart of a wellbore data consistency verification method provided in this embodiment of the disclosure. See also: Figure 4 The consistency verification method for this wellbore data includes:

[0133] 401. The second electronic device receives the form and verification string S from the first electronic device in the wellbore data acquisition system.

[0134] The second electronic device can parse the received data packet to obtain the form and the verification string S. For example, the second electronic device can extract the verification string from a specified position in the data packet, which is used to store the verification string to be verified by the data receiving end. As another example, the second electronic device can extract the verification string from the form. This application embodiment does not limit the method used for packaging.

[0135] 402. The second electronic device obtains the form content in the form, adds a first character to every two fields in the form content, and adds a second character between every two lines in the form content to obtain the first array A.

[0136] When the form is a two-dimensional form, each row of the form includes multiple fields. Therefore, "\t" can be added between every two fields, and "\r" and "\n" can be added between every two rows to separate the fields and the rows, thereby converting the two-dimensional form into a one-dimensional first array. Other symbols can also be used to separate fields and rows, and this application embodiment does not limit this.

[0137] 403. The second electronic device obtains the length of the first array A; divides the length by a constant 64 to obtain the number of blocks; and divides the first array A according to the number of blocks to obtain multiple data segments.

[0138] By dividing the length by a constant 64, the first array can be divided into multiple 64-bit data segments, ensuring that subsequent array transformations can be performed based on data segments of the same length. Of course, if the length of the first array exceeds the target length, when dividing based on the number of blocks, every 2N (where N is an integer greater than or equal to 1) 64-bit data segments can be divided into a single data fragment. That is, the division method can be adjusted according to the actual length of the first data segment, using 64 bits as the base fragment length, so that regardless of the division method, the number of data fragments obtained is the same, thus ensuring that the number of elements in the resulting second array is the same during subsequent processing.

[0139] 404. The second electronic device converts the multiple data fragments into Ulong type respectively to obtain the second array B.

[0140] Among them, Ulong (unsigned long integer) refers to storing characters as a 32-bit (4-byte) numerical form.

[0141] 405. The second electronic device acquires hexadecimal variables S1, S2, S3 and S4; sets four hexadecimal constants and assigns them to the hexadecimal variables S1, S2, S3 and S4 to obtain the first parameters SA1, SA2, SA3 and SA4.

[0142] Step 405 above describes the process by which the second electronic device acquires the first parameters SA1, SA2, SA3, and SA4. These four variables can be arbitrary, and this application does not impose any restrictions on them. The second electronic device can randomly generate four hexadecimal constants to assign values ​​to the above variables.

[0143] In some embodiments, the second electronic device can generate a corresponding hexadecimal constant based on the device information of the first electronic device that is stored in advance, such as device type and device identifier. This can ensure the legitimacy of the data sending device during verification at the data receiving end and prevent problems such as data tampering.

[0144] 406. The second electronic device uses the first parameters SA1, SA2, SA3 and SA4 and the second array B as inputs to the MD5 checksum algorithm to obtain the second parameters SA1', SA2', SA3' and SA4'.

[0145] After generating the first parameter, the second electronic device can input the generated first parameter and the second array B into the MD5 checksum generator. The generator uses the MD5 checksum algorithm to process the input data and obtain the second parameter.

[0146] In some embodiments, the second electronic device concatenates the first parameters SA1, SA2, SA3 and SA4 to the second array B to obtain the corresponding first intermediate parameters, and then inputs the concatenated first intermediate parameters into the MD5 checksum generator to obtain the corresponding second parameters SA1', SA2', SA3' and SA4'.

[0147] In some embodiments, the second electronic device splits the second array B into four data segments, concatenates each data segment with the first parameters SA1, SA2, SA3 and SA4 respectively to obtain the corresponding second intermediate parameters, and then inputs the multiple second intermediate parameters obtained by concatenation into the MD5 checksum generator to obtain the corresponding second parameters SA1', SA2', SA3' and SA4'.

[0148] The two processing methods described above are merely examples of generating the second parameter based on the first parameters SA1, SA2, SA3, and SA4 and the second array B. In other embodiments, the second parameter can also be generated based on the transformation of the second array and the multiple first parameters. This application does not limit this approach.

[0149] 407. The second electronic device generates a verification string S' based on the second parameters SA1', SA2', SA3' and SA4'.

[0150] In the embodiments of this application, the above-mentioned verification string can be generated by concatenating multiple second parameters. In some embodiments, the second electronic device can concatenate the above-mentioned multiple second parameters in a preset order, for example, concatenating them in ascending order of parameter number or in descending order of parameter number, which is not limited here.

[0151] Of course, in some embodiments, the verification string can also be obtained based on the string obtained by concatenating multiple second parameters. For example, the second electronic device extracts the first preset number of characters from the string obtained after concatenation as the verification string to increase the complexity of subsequent verification and thus improve data security.

[0152] 408. The second electronic device compares its own generated verification string S' with the received verification string S.

[0153] 409. If the second electronic device determines that the verification strings S and S' are consistent, then the form verification passes.

[0154] Furthermore, after confirming that the form has passed validation, the second electronic device stores the received form in the database.

[0155] 410. If the second electronic device determines that the verification strings S and S' are inconsistent, it returns a sending failure response to the first electronic device, which instructs the first electronic device to resend the form.

[0156] In some embodiments, if the second electronic device determines that the verification strings S and S' are inconsistent, it can also issue a warning to the management user to report potential data security risks.

[0157] On the second electronic device side, by adopting the same verification string generation method as on the first electronic device side, the MD5 data transmission verification algorithm can be used to compare the verification strings at the data receiving end, thereby achieving a comparison of the entire database.

[0158] The method provided in this application embodiment converts, segments, and performs secondary conversion on wellbore data, and obtains a check string based on the converted array and MD5 algorithm. This allows the check string to be transmitted simultaneously with the wellbore data, enabling the data receiving end to verify the wellbore data based on the check string. This achieves data consistency verification, ensuring data consistency during transmission and guaranteeing data accuracy.

[0159] In the above technical solution, by configuring corresponding verification methods at both the data sending end and the data receiving end of the system, the sending and receiving ends can ensure data consistency and accuracy through data verification.

[0160] Figure 5 This is a schematic diagram of a wellbore data consistency verification device provided in an embodiment of this application, which is applied to the first electronic device in a wellbore data acquisition system. See also... Figure 5 The device includes:

[0161] Acquisition module 501 is used to acquire a form to be transmitted, the form containing wellbore data;

[0162] The first conversion module 502 is used to convert the content of the form to obtain a first array A, wherein the first array is the form represented by a character array;

[0163] The segmentation module 503 is used to divide the first array A into multiple data segments;

[0164] The second conversion module 504 is used to convert the multiple data fragments into Ulong type respectively to obtain the second array B;

[0165] The first parameter acquisition module 505 is used to acquire the first parameters SA1, SA2, SA3 and SA4;

[0166] The second parameter acquisition module 506 is used to take the first parameters SA1, SA2, SA3 and SA4 and the second array B as inputs to the MD5 checksum algorithm to obtain the second parameters SA1', SA2', SA3' and SA4'.

[0167] The string generation module 507 is used to generate a verification string S based on the second parameters SA1', SA2', SA3', and SA4'.

[0168] The sending module 508 is used to transmit the verification string S and the form together to the second electronic device, wherein the verification string S is used by the second electronic device to verify the form.

[0169] In one possible implementation, the first conversion module 502 is used to obtain the form content in the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain a first array A.

[0170] In one possible implementation, the segmentation module 503 is used to obtain the length of the first array A; divide the length by a constant 64 to obtain the number of blocks; and divide the first array A according to the number of blocks to obtain multiple data segments.

[0171] In one possible implementation, the first parameter acquisition module 505 is used to acquire hexadecimal variables S1, S2, S3 and S4; and to assign four hexadecimal constants to the hexadecimal variables S1, S2, S3 and S4 to obtain the first parameters SA1, SA2, SA3 and SA4.

[0172] Figure 6 This is a schematic diagram of a wellbore data consistency verification device provided in an embodiment of this application, which is a second electronic device applied in a wellbore data acquisition system. See also... Figure 6 The device includes:

[0173] The receiving module 601 is used to receive a form and a verification string S from the first electronic device in the wellbore data acquisition system;

[0174] The first conversion module 602 is used to convert the content of the form to obtain a first array A, wherein the first array is the form represented by a character array;

[0175] The segmentation module 603 is used to divide the first array A into multiple data segments;

[0176] The second conversion module 604 is used to convert the multiple data fragments into Ulong type respectively to obtain the second array B;

[0177] The first parameter acquisition module 605 is used to acquire the first parameters SA1, SA2, SA3 and SA4;

[0178] The second parameter acquisition module 606 is used to take the first parameters SA1, SA2, SA3 and SA4 and the second array B as inputs to the MD5 checksum algorithm to obtain the second parameters SA1', SA2', SA3' and SA4'.

[0179] The string generation module 607 is used to generate a verification string S' based on the second parameters SA1', SA2', SA3' and SA4';

[0180] The comparison module 608 is used to compare the verification strings S and S'; if the verification strings S and S' are consistent, the form verification passes.

[0181] In one possible implementation, the first conversion module 602 is used to obtain the form content in the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain a first array A.

[0182] In one possible implementation, the segmentation module 603 is used to obtain the length of the first array A; divide the length by a constant 64 to obtain the number of blocks; and divide the first array A according to the number of blocks to obtain multiple data segments.

[0183] In one possible implementation, the first parameter acquisition module 605 is used to acquire hexadecimal variables S1, S2, S3 and S4; and to assign four hexadecimal constants to the hexadecimal variables S1, S2, S3 and S4 to obtain the first parameters SA1, SA2, SA3 and SA4.

[0184] It should be noted that the wellbore data consistency verification device provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the wellbore data consistency verification device and the wellbore data consistency verification method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0185] Figure 7 This is a schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present disclosure. The electronic device 700 can vary considerably due to differences in configuration or performance. It may include one or more Central Processing Units (CPUs) 701 and one or more memories 702. The one or more memories 702 store at least one line of program code, which is loaded and executed by the one or more processors 701 to implement the methods provided in the various method embodiments described above. Of course, the electronic device 700 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The electronic device 700 may also include other components for implementing device functions, which will not be elaborated upon here.

[0186] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including program code that can be executed by a processor to perform the wellbore data consistency verification method in the above embodiments. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, or optical data storage device, etc.

[0187] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer program code stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to perform the method steps for verifying the consistency of wellbore data provided in the above embodiments.

[0188] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program or program code related to hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0189] The above are merely optional embodiments of this disclosure and are not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.

Claims

1. A method for verifying the consistency of wellbore data, characterized in that, A first electronic device applied in a wellbore data acquisition system, the method comprising: Obtain the form to be transmitted, the form containing wellbore data; Obtain the form content from the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain a first array A, wherein the first array represents the form as a character array; The first array A is divided into multiple data segments; Each of the multiple data fragments is converted to a Ulong type to obtain the second array B; Obtain the first parameters SA1, SA2, SA3, and SA4; The second array B is split into four data segments, and the four data segments are concatenated with the first parameters SA1, SA2, SA3 and SA4 respectively to obtain a plurality of corresponding second intermediate parameters; the plurality of second intermediate parameters are input into the MD5 checksum generator to obtain the second parameters SA1', SA2', SA3' and SA4'. The second parameters SA1', SA2', SA3' and SA4' are concatenated to obtain a string. The first preset number of characters are extracted from the string and used as the verification string S. The verification string S and the form are transmitted together to the second electronic device. The verification string S is used by the second electronic device to verify the form. The second electronic device is used to perform the following steps based on the form: obtaining the form content in the form, adding a first character to every two fields in the form content, adding a second character between every two lines in the form content, and obtaining a first array A, until the verification string S' is obtained, and the verification string S and S' are compared.

2. The method according to claim 1, characterized in that, The process of dividing the first array A into multiple data segments includes: Get the length of the first array A; Divide the length by a constant 64 to obtain the number of blocks. Divide the first array A into multiple data segments according to the number of blocks.

3. The method according to claim 1, characterized in that, The acquisition of the first parameters SA1, SA2, SA3, and SA4 includes: Get the hexadecimal variables S1, S2, S3, and S4; Four hexadecimal constants are assigned to the hexadecimal variables S1, S2, S3, and S4 to obtain the first parameters SA1, SA2, SA3, and SA4.

4. A method for verifying the consistency of wellbore data, characterized in that, A second electronic device applied in a wellbore data acquisition system, the method comprising: Receive a form and a verification string S from the first electronic device in the wellbore data acquisition system; Obtain the form content from the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain a first array A, wherein the first array represents the form as a character array; The first array A is divided into multiple data segments; Each of the multiple data fragments is converted to a Ulong type to obtain the second array B; Obtain the first parameters SA1, SA2, SA3, and SA4; The second array B is split into four data segments, and the four data segments are concatenated with the first parameters SA1, SA2, SA3 and SA4 respectively to obtain a plurality of corresponding second intermediate parameters; the plurality of second intermediate parameters are input into the MD5 checksum generator to obtain the second parameters SA1', SA2', SA3' and SA4'. The second parameters SA1', SA2', SA3' and SA4' are concatenated to obtain a string. The first preset number of characters are extracted from the string and used as the verification string S'. Compare the verification strings S and S'; If the verification strings S and S' are consistent, the form verification passes.

5. The method according to claim 4, characterized in that, The process of dividing the first array A into multiple data segments includes: Get the length of the first array A; Divide the length by a constant 64 to obtain the number of blocks. Divide the first array A into multiple data segments according to the number of blocks.

6. The method according to claim 4, characterized in that, The acquisition of the first parameters SA1, SA2, SA3, and SA4 includes: Get the hexadecimal variables S1, S2, S3, and S4; Four hexadecimal constants are assigned to the hexadecimal variables S1, S2, S3, and S4 to obtain the first parameters SA1, SA2, SA3, and SA4.

7. A wellbore data consistency verification device, characterized in that, A first electronic device applied in a wellbore data acquisition system, the device comprising: The acquisition module is used to acquire the form to be transmitted, which contains wellbore data; The first conversion module is used to obtain the form content in the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain a first array A, wherein the first array is the form represented by a character array; The segmentation module is used to divide the first array A into multiple data segments; The second conversion module is used to convert the multiple data fragments into Ulong type respectively to obtain the second array B; The first parameter acquisition module is used to acquire the first parameters SA1, SA2, SA3 and SA4; The second parameter acquisition module is used to split the second array B into four data segments, concatenate the four data segments with the first parameters SA1, SA2, SA3 and SA4 respectively to obtain a plurality of corresponding second intermediate parameters; input the plurality of second intermediate parameters into the MD5 checksum generator to obtain the second parameters SA1', SA2', SA3' and SA4'. The string generation module is used to concatenate the second parameters SA1', SA2', SA3' and SA4' to obtain a string, and extract the first preset number of characters from the string as the verification string S; The sending module is used to transmit the verification string S and the form together to the second electronic device. The verification string S is used by the second electronic device to verify the form. The second electronic device is used to perform the following steps based on the form: obtaining the form content in the form, adding a first character to every two fields in the form content, adding a second character between every two lines in the form content, and obtaining a first array A, until the verification string S' is obtained, and comparing the verification string S and S'.

8. A wellbore data consistency verification device, characterized in that, A second electronic device used in a wellbore data acquisition system, the device comprising: The receiving module is used to receive the form and verification string S from the first electronic device in the wellbore data acquisition system; The first conversion module is used to obtain the form content in the form, add a first character to every two fields in the form content, and add a second character between every two lines in the form content to obtain a first array A, wherein the first array is the form represented by a character array; The segmentation module is used to divide the first array A into multiple data segments; The second conversion module is used to convert the multiple data fragments into Ulong type respectively to obtain the second array B; The first parameter acquisition module is used to acquire the first parameters SA1, SA2, SA3 and SA4; The second parameter acquisition module is used to split the second array B into four data segments, concatenate the four data segments with the first parameters SA1, SA2, SA3 and SA4 respectively to obtain a plurality of corresponding second intermediate parameters; input the plurality of second intermediate parameters into the MD5 checksum generator to obtain the second parameters SA1', SA2', SA3' and SA4'. The string generation module is used to concatenate the second parameters SA1', SA2', SA3' and SA4' to obtain a string, and extract the first preset number of characters from the string as the verification string S'; The comparison module is used to compare the verification strings S and S'; if the verification strings S and S' are consistent, the form verification passes.

Citation Information

Patent Citations

  • Data verification method and device based on hash algorithm, equipment and storage medium

    CN110503434A