Information storage method and device, computer device and storage medium

By converting Boolean variables to two's complement integer variables for storage, the problem of Boolean variables occupying a large amount of storage space is solved, achieving more efficient storage and retrieval.

CN116204529BActive Publication Date: 2026-01-13IND BANK CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310101621.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-08
Publication Date
2026-01-13
Estimated Expiration
2043-02-08

AI Technical Summary

Technical Problem

During project development, using Boolean variables to store large amounts of data occupies unnecessary storage space, leading to reduced storage and retrieval efficiency.

Method used

By converting Boolean variables to integer variables in two's complement form for storage, multiple Boolean variables can be represented using the 4 bytes of space of an integer variable, thus reducing storage space usage.

Benefits of technology

It effectively reduces storage space consumption, improves storage and retrieval efficiency, and can store one more bit of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116204529B_ABST
    Figure CN116204529B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an information storage method, device, computer equipment and storage medium. The method comprises: obtaining data identification information to be stored and data state information corresponding to the data identification information, wherein the data state information comprises system mark information described by a Boolean variable; determining state original code information corresponding to the data state information by taking the data state information as a complement; determining an integer variable to be stored corresponding to the state original code information; and storing the integer variable to be stored and the data identification information to be stored. The method can reduce the space occupied when storing data state information, and does not need to occupy a large amount of storage space when storing related information, thereby reducing the consumption of storage resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data storage technology, and in particular to an information storage method, apparatus, computer equipment, and storage medium. Background Technology

[0002] During project development, Boolean variables are typically used to store relevant information. The value of a Boolean variable is usually "0" or "1", with "0" and "1" representing different information. A Boolean variable typically occupies at least one byte of storage space.

[0003] When dealing with a large amount of Boolean data that needs to be stored or retrieved, such as hourly online status records of terminals or daily check-in records of users, multiple Boolean variables are required for processing. This increases unnecessary space usage, consumes a lot of storage resources, and reduces the efficiency of data storage or retrieval. Summary of the Invention

[0004] Therefore, it is necessary to provide an information storage method, apparatus, computer equipment, or storage medium that reduces the storage resources required when storing Boolean variables, in order to address the aforementioned technical problems.

[0005] In a first aspect, this disclosure provides an information storage method, the method comprising:

[0006] Obtain the data identification information to be stored and the data status information corresponding to the data identification information, wherein the data status information includes: system tag information described using Boolean variables;

[0007] Using the data status information as complement, determine the original code information of the status corresponding to the data status information;

[0008] Determine the integer variable to be stored corresponding to the original code information of the state;

[0009] The integer variable to be stored and the data identifier information to be stored are stored.

[0010] In one embodiment, the method further includes: in response to the need to obtain data status information corresponding to the data identification information, obtaining the integer variable to be stored corresponding to the identification information based on the data identification information;

[0011] Determine the original code data corresponding to the integer variable to be stored;

[0012] Determine the complement data corresponding to the original code data, and determine the data status information corresponding to the data identifier information based on the complement data.

[0013] In one embodiment, after determining the source code data corresponding to the integer variable to be stored, the method further includes:

[0014] In response to the fact that the bit width of the original code data is less than the bit width of the data status information, and the bit width of the data status information is less than or equal to 32 bytes, the original code data is padded so that the bit width of the padded original code data is equal to the bit width of the data status information.

[0015] Accordingly, determining the complement data corresponding to the original code data includes:

[0016] The corresponding complement data is determined based on the original code data obtained after padding.

[0017] In one embodiment, determining the integer variable to be stored corresponding to the state source code information includes:

[0018] In response to the data status information having a bit width of less than or equal to 32 bytes, the status source code information is converted into the corresponding integer variable to be stored.

[0019] In one embodiment, determining the state source code information corresponding to the data state information further includes:

[0020] In response to the data status information having a bit width greater than 32 bytes, the data status information is divided according to a preset first bit width to obtain multiple sub-status information, wherein the first bit width is 32 bytes;

[0021] Using the complement of each sub-state information, determine the original code information of the sub-state corresponding to each sub-state information.

[0022] In one embodiment, determining the data status information corresponding to the data identifier information based on the complement data includes:

[0023] In response to the existence of multiple sub-state source code information, obtain each of the sub-state source code information;

[0024] Determine the corresponding sub-state complement information based on the original code information of each sub-state;

[0025] The sub-state information is determined based on the sub-state complement information;

[0026] By concatenating multiple sub-state information, data state information corresponding to the data identifier information is obtained.

[0027] Secondly, this disclosure also provides an information storage device. The device includes:

[0028] The information acquisition module is used to acquire data identification information to be stored and data status information corresponding to the data identification information. The data status information includes system tag information described by Boolean variables.

[0029] The information processing module is used to determine the original code information of the status corresponding to the data status information by using the data status information as complement.

[0030] The variable determination module is used to determine the integer variable to be stored corresponding to the state source code information;

[0031] The storage module is used to store the integer variable to be stored and the data identification information to be stored.

[0032] Thirdly, this disclosure also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of any of the above-described method embodiments.

[0033] Fourthly, this disclosure also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of any of the above-described method embodiments.

[0034] Fifthly, this disclosure also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of any of the above-described method embodiments.

[0035] In the above embodiments, by obtaining the data identifier information to be stored and the data status information corresponding to the data identifier information, and using the data status information as complement, the original code information of the status corresponding to the data status information is determined; the integer variable to be stored corresponding to the original code information of the status is determined. Since directly converting the data status information to the integer variable to be stored requires considering the influence of the sign bit, and considering the case of negative numbers, and since 0 corresponds to two binary original codes, if the original code method is used and the sign bit is not ignored, the conversion between binary and decimal numbers cannot accurately determine the corresponding integer variable to be stored. Therefore, the complement method is needed. Since integer variables typically occupy four bytes of storage space, while each Boolean variable of the data status information typically occupies one byte, and when the data status information exceeds four bytes of storage space, the integer variable to be stored and the data identifier information to be stored are stored. Using the integer variable to be stored to identify the data status information corresponding to the data identifier information can reduce the space occupied when storing the data status information. When storing related information, it is not necessary to occupy a large amount of storage space, thus reducing the consumption of storage resources. Furthermore, it can store one more bit of data compared to the method of ignoring the sign bit. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0037] Figure 1 This is a schematic diagram illustrating the application environment of an information storage method in one embodiment;

[0038] Figure 2 This is a flowchart illustrating an information storage method in one embodiment;

[0039] Figure 3 This is a flowchart illustrating an information acquisition method in one embodiment;

[0040] Figure 4 This is a schematic diagram of the processing procedure in one embodiment;

[0041] Figure 5 This is a flowchart illustrating the process after step S304 in one embodiment;

[0042] Figure 6 This is a flowchart illustrating step S206 in one embodiment;

[0043] Figure 7This is a flowchart illustrating step S306 in one embodiment;

[0044] Figure 8 This is a flowchart illustrating the information storage process in another embodiment of the information storage and retrieval method;

[0045] Figure 9 This is a schematic diagram of the information retrieval process in another embodiment of the information storage and retrieval method;

[0046] Figure 10 This is a schematic block diagram of the structure of an information storage device in one embodiment;

[0047] Figure 11 This is a schematic diagram of the internal structure of a computer device in one embodiment. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this disclosure.

[0049] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings herein are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0050] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0051] As described in the background section, converting a Boolean variable to an int type for storage can reduce the space occupied. However, the first bit of an int variable converted to binary is the sign bit. Therefore, when performing binary conversion, or when using int type for storage, this sign bit is usually not considered, which wastes one bit of space in the int type and fails to fully utilize the space occupied by the int type.

[0052] Therefore, to solve the above problems, this disclosure provides an information storage method that can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with business server 104 via a network. A data storage system can store the data that business server 104 needs to process. The data storage system can be integrated onto business server 104 or placed on the cloud or other network servers. Terminal 102 can obtain the data identification information to be stored and the corresponding data status information from business server 104. The data status information includes system tag information of business server 104 described using Boolean variables. Terminal 102 uses the data status information as complement to determine the corresponding status original code information. Terminal 102 determines the integer variable to be stored corresponding to the status original code information. Terminal 102 stores the integer variable to be stored and the data identification information to be stored. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. The business server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers. It is understood that the methods in this embodiment can also be applied individually to a terminal or a server.

[0053] In one embodiment, such as Figure 2 As shown, an information storage method is provided, which can be applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps:

[0054] S202, obtain the data identification information to be stored and the data status information corresponding to the data identification information, wherein the data status information includes: system tag information described by Boolean variables.

[0055] System tagging information typically refers to information generated or recorded during the processing of different business operations. Data identification information typically requires a large number of Boolean variables to record. For example, in banking, data identification information could be system business information such as whether a customer is a dormant account, a high-net-worth user, or a valid account. In production and operation, data identification information could be system business information such as whether a product has been shipped, whether the product is qualified, or whether the product model is correct. Depending on the specific business application scenario, the data identification information varies, and specific data identification information is not limited in some embodiments of this disclosure. Data status information can typically be system business information described by Boolean variables; for example, a dormant customer can be represented by 1, and a non-dormant customer by 0. Each data tagging information will have corresponding data status information.

[0056] Specifically, when there is a large amount of data identification information to be stored, each data identification information may correspond to one or more data status information. Therefore, it is necessary to obtain the data identification information to be stored and the data status information corresponding to the data identification information.

[0057] S204, using the data status information as complement, determine the status original code information corresponding to the data status information.

[0058] S206, determine the integer variable to be stored corresponding to the original code information of the state.

[0059] Two's complement is a method of representing signed numbers in binary, and also a way to change the sign of numbers. The original code information of the status is usually a binary fixed-point representation of numbers in a computer; in this embodiment, it can generally be understood as an encoding method. The integer variable to be stored is usually an `int` variable, which represents integer data. An `int` variable typically occupies 4 bytes of storage space and is represented in decimal, with a range typically between -2^3 and 2^3. 31 Up to 2 31 Between -1 and 1. Specifically, the data status information can be used as the two's complement, and then the original code corresponding to the two's complement can be determined to obtain the status original code information.

[0060] Specifically, an Int type variable typically occupies 4 bytes of storage space and is represented in decimal, with a range usually of -2. 31 Up to 2 31-1. If an `int` variable is converted to binary, each bit is either 0 or 1, occupying a total of 32 bits. This is just enough to represent a string of "0" and "1" characters, and the space occupied is much smaller than the latter (the latter occupies 32 bytes, and one byte equals 8 bits). However, since the first bit of an `int` variable after conversion to binary is the sign bit, a signed `int` can represent up to 32 bits of "0" and "1" tag data during binary conversion; without considering the sign bit, an `int` can usually only represent up to 31 bits of "0" and "1" tag data, because the upper limit of `int` is often 2 to the power of 31. Using a signed `int` can represent one more "0" or "1" tag data. Therefore, the case of negative numbers must be considered. For simplicity, we'll initially consider using the binary representation of numbers to represent tag information. However, since 0 has two binary representations, using this representation for binary-to-decimal conversion leads to the following: the number 0 can be converted to either 00000000...00000000 or 10000000...00000000. Therefore, when encountering the number 0, we cannot determine whether it represents the binary tag 00000000...00000000 or 10000000...00000000. Simply using the original representation results in situations where either 000000...000000 or 100000...000000 cannot be described by an `int` type. In other words, determining the corresponding representation using 0 yields two results, making it impossible to determine which one is the desired outcome.

[0061] Furthermore, data status information can be viewed as binary representation, but it is typically a Boolean variable of type CHAR, with each unit of the data status information usually occupying one byte of space. Therefore, when there are more than four units in the data status information, representing it with integer variables will reduce storage space. Additionally, to eliminate the influence of the sign, the data status information can be viewed as two's complement information. Then, the corresponding original code information of the status can be determined, and the original code information of the status can be converted into an integer variable to be stored.

[0062] In some exemplary embodiments, for example, if the data status information is 1011001, then its corresponding status source code information can be 0100111, which can be converted into an integer variable to be stored as 39. As shown in Table 1, the conversion relationship between data status information, status source code information, and integer variables to be stored is shown.

[0063] Table 1 Conversion Relationship Table

[0064]

[0065]

[0066] S208, store the integer variable to be stored and the data identifier information to be stored.

[0067] Specifically, the integer variables to be stored and the data identifier information to be stored can be stored in a certain mapping relationship.

[0068] In some exemplary embodiments, the integer variable to be stored and the data identifier information to be stored can be stored using a bitmap index. Table 2, the bitmap index table, can be used to store the data identifier information and the data status information corresponding to the data identifier information.

[0069] Table 2 Bitmap Index Table

[0070]

[0071] In the above information storage method, by obtaining the data identifier information to be stored and the data status information corresponding to the data identifier information, and using the data status information as complement, the original code information of the status corresponding to the data status information is determined; the integer variable to be stored corresponding to the original code information of the status is then determined. Since directly converting the data status information to the integer variable to be stored requires considering the influence of the sign bit, and considering the case of negative numbers, and since 0 corresponds to two binary original codes, if the original code method is used and the sign bit is not ignored, the conversion between binary and decimal numbers cannot accurately determine the corresponding integer variable to be stored. Therefore, the complement method is needed. Since integer variables typically occupy four bytes of storage space, while each Boolean variable of the data status information typically occupies one byte, and the data status information exceeds four bytes of storage space, storing the integer variable to be stored and the data identifier information is performed. Using the integer variable to be stored to identify the data status information corresponding to the data identifier information can reduce the space occupied when storing the data status information. When storing relevant information, it is not necessary to occupy a large amount of storage space, thus reducing the consumption of storage resources. Furthermore, it can store one more bit of data compared to the method of ignoring the sign bit.

[0072] In one embodiment, such as Figure 3 As shown, the method further includes:

[0073] S302, in response to the need to obtain data status information corresponding to the data identification information, the integer variable to be stored corresponding to the data identification information is obtained according to the data identification information.

[0074] S304, determine the original code data corresponding to the integer variable to be stored.

[0075] S306, determine the complement data corresponding to the original code data, and determine the data status information corresponding to the data identifier information based on the complement data.

[0076] In this context, the original code data is usually a binary fixed-point representation of numbers in a computer, and in this embodiment, it can generally be understood as an encoding method.

[0077] Specifically, when it is necessary to obtain data status information corresponding to a data identifier, since the integer variable to be stored and the data identifier to be stored have already been stored, the corresponding integer variable to be stored can be found based on the data identifier. Typically, the integer variable to be stored is decimal and a positive number. Therefore, it needs to be converted to binary to determine the data status information. The original code data corresponding to the integer variable to be stored is then determined. Because there is a sign bit in this case, to eliminate the influence of the sign bit, the original code data can be converted to two's complement data, and then the data status information can be determined based on each binary value in the two's complement data. Typically, each value in a binary number has its corresponding meaning. For example, binary 010 can typically be used to determine whether the account is a dormant account, a high-net-worth user, or a suspicious account. The meaning of the corresponding setting varies depending on the situation. Those skilled in the art can determine the meaning of each value in the binary number based on actual needs. In some embodiments of this disclosure, the specific meaning of each value in the binary number is not limited.

[0078] In some exemplary embodiments, for example, if the STATUS of an account is 89, the binary number (two's complement) corresponding to 89 is 1011001. Normally, the data status information is 32 bits, so padding is required. After padding, the data status information corresponding to the account's STATUS field can be: "00000000000000000000000001011001". However, if the STATUS is -89, since the binary number (two's complement) corresponding to -89 is 10100111, the data status information corresponding to the account's STATUS field is: "11111111111111111111111110100111". Compared to directly using CHAR(32) to describe the data status information, using an integer variable to be stored to describe the data status information can reduce the space occupancy rate to one-eighth of the original. We can use FLAG1, FLAG2...FLAG31, FLAG32, arranged from right to left, to represent the data status information converted from binary numbers when STATUS=-89. Therefore, we have: FLAG1=1, FLAG2=1, FLAG3=1, FLAG4=0, FLAG5=0, FLAG6=1, FLAG7=0, FLAG8=1, and the remaining FLAG9 to FLAG32 are all equal to 1. Through... Figure 4 The program shown calculates the data status information corresponding to the int type variable and the data identifier information, and can be run directly in the database. Figure 4 The program in the middle.

[0079] In this embodiment, when it is necessary to obtain data status information, the corresponding variable to be stored can be matched in the bitmap index table using data identification information. Then, the original code data corresponding to the variable to be stored is converted into complement data, and the data status information is determined based on the complement data. This can significantly reduce the space occupancy rate of database fields and determine the desired data status information.

[0080] In one embodiment, such as Figure 5 As shown, after determining the original code data corresponding to the integer variable to be stored, the method further includes:

[0081] S402, determine whether the bit width of the original code data is less than the bit width of the data status information.

[0082] S404, in response to the fact that the bit width of the original code data is less than the bit width of the data status information, and the bit width of the data status information is less than or equal to 32 bytes, the original code data is padded so that the bit width of the padded original code data is equal to the bit width of the data status information.

[0083] The bit width typically refers to the number of bits in the original code data or data status information. For example, if the original code information is 0101, its bit width can be 4 bytes. In some embodiments of this disclosure, the bit width of the data status information is generally 32 bytes, and the corresponding bit width of the data status information is usually set during storage.

[0084] Specifically, first, it is determined whether the bit width of the obtained original code data is less than the bit width of the data status information. If it is less, it proves that the original code data is incomplete. If the complement data is determined through the incomplete original code data, and then the data status information is determined based on the complement data, the final information may also be missing. Therefore, it is necessary to pad the original code data. Usually, 0 or 1 is used for padding so that the bit width of the padded original code data is the same as the bit width of the data status information.

[0085] In some exemplary embodiments, for example, the bit width of the original code data is 8 bytes, while the bit width of the data status information is 32 bytes. If padding is not performed, the complement data obtained by converting the original code data will also be 8 bytes, resulting in a missing 24 bytes of information. Therefore, padding is required to ensure the integrity of the information.

[0086] S406, correspondingly, determining the complement data corresponding to the original code data includes: determining the corresponding complement data based on the original code data obtained after padding.

[0087] Specifically, when the original code data is padded, the padded original code data and the data status information have the same bit width. Therefore, the padded original code data is converted into two's complement data. The data status information determined by the two's complement data will not have any missing information. Therefore, the corresponding two's complement data can be determined based on the padded original code data, and then the data status information can be determined based on the two's complement data.

[0088] In this embodiment, when the bit width of the original code data is less than the bit width of the data status information, padding can be performed to avoid missing data information.

[0089] In one embodiment, such as Figure 6 As shown, determining the integer variable to be stored corresponding to the original code information of the state includes:

[0090] S502, determine whether the bit width of the data status information is less than or equal to 32 bytes.

[0091] S504, in response to the data status information having a bit width of less than or equal to 32 bytes, the status source code information is converted into the corresponding integer variable to be stored.

[0092] Specifically, first determine whether the bit width of the data status information to be stored is less than or equal to 32 bytes. If so, an integer variable can be used to represent it. Therefore, the data status information can be directly converted into status source code information, and then the status source code information can be converted into the corresponding integer variable to be stored.

[0093] S506, in response to the data status information having a bit width greater than 32 bytes, the data status information is divided according to a preset first bit width to obtain multiple sub-status information, wherein the first bit width is 32 bytes.

[0094] S508, using the complement of each of the sub-state information, determine the original code information of the sub-state corresponding to each of the sub-state information.

[0095] Specifically, when the bit width of the data status information is greater than 31 bytes, since a single integer variable can typically represent a maximum of 32 bytes, multiple integer variables are needed. Multiple sub-status information can be obtained by grouping data into sets of 32 bytes, according to a preset bit width. Each sub-status information is then used as its complement, and the corresponding original code information of the sub-status is determined.

[0096] In some exemplary embodiments, for example, if the data status information is 86 bits, then three sub-status information can be obtained, namely the first sub-status information, the second sub-status information, and the third sub-status information. The first and second sub-status information can each be 32 bytes, and the third sub-status information can be 22 bytes.

[0097] In this embodiment, when the stored data status information is greater than 32 bytes, it can be split and stored separately using integer variables. Each integer representing the data status information occupies only 4 bytes. Taking 86 bytes of data status information as an example, only 4 × 3 = 12 bytes are needed using the variables to be stored, reducing the space occupancy rate to 12 / 86 = 13.9% of the original. This method effectively improves space utilization when there is a large amount of data status information.

[0098] In one embodiment, such as Figure 7 As shown. The step of determining the data status information corresponding to the data identifier information based on the complement data includes:

[0099] S602, in response to the existence of multiple sub-state source code information, obtain each sub-state source code information;

[0100] S604, determine the corresponding sub-state complement information based on the original code information of each sub-state;

[0101] S606, determine the sub-state information based on the sub-state complement information;

[0102] S608, concatenate multiple sub-state information to obtain data state information corresponding to the data identifier information.

[0103] Among these, splicing can usually be done according to the splitting order of the original code data or data state information.

[0104] Specifically, when the bit width of the data status information is greater than 32 bytes, a single integer is usually insufficient to represent it. Therefore, as in the above embodiment, it is split into multiple sub-state source code information. Then, multiple integer variables to be stored are determined based on the multiple sub-state source code information. At this point, the multiple integer variables to be stored obtained after splitting can be acquired, and the sub-state source code information corresponding to each integer variable can be obtained. Then, multiple sub-state complement information is determined based on the multiple sub-state source code information. Each sub-state complement information can usually be a sub-state information. The multiple sub-state complement information is concatenated in a certain order to obtain the data status information.

[0105] In some exemplary embodiments, each sub-state information can be marked at the data state information position, and then multiple sub-state information can be concatenated according to the order of the markings.

[0106] In this embodiment, when the bit width of the data status information is greater than 32 bytes, multiple sub-state original code information can be obtained. Then, the corresponding sub-state complement information is determined based on the multiple sub-state original code information, and multiple sub-state information is determined. The multiple sub-state information is concatenated to obtain the data status information. This ensures that even when the bit width of the data status information is greater than 32 bytes, the corresponding data status information can still be accurately obtained, thus ensuring the accuracy of the data.

[0107] In one embodiment, such as Figure 8 and Figure 9 As shown in the embodiments of this disclosure, an information storage and retrieval method is also provided, including:

[0108] Stored procedure: S702, obtain the data identification information to be stored and the data status information corresponding to the data identification information, wherein the data status information includes: system tag information described by Boolean variables.

[0109] S704 determines whether the bit width of the data status information is less than or equal to 32 bytes.

[0110] S706, in response to the data status information having a bit width of less than or equal to 32 bytes, using the data status information as complement, determine the status source code information corresponding to the data status information, and convert the status source code information into the corresponding integer variable to be stored.

[0111] S708, in response to the data status information having a bit width greater than 32 bytes, the data status information is divided according to a preset first bit width to obtain multiple sub-status information, wherein the first bit width is 32 bytes.

[0112] S710, using each of the sub-state information as complement, determine the original code information of the sub-state corresponding to each of the sub-state information.

[0113] S712 converts the source code information of each sub-state into the corresponding variable to be stored.

[0114] S714, store the integer variable to be stored and the data identifier information to be stored.

[0115] Data acquisition process:

[0116] S716, in response to the need to obtain data status information corresponding to the data identification information, obtain the integer variable to be stored corresponding to the identification information according to the data identification information.

[0117] S718, determine the original code data corresponding to the integer variable to be stored.

[0118] S720, determine the complement data corresponding to the original code data, and determine the data status information corresponding to the data identifier information based on the complement data.

[0119] S722, in response to the existence of multiple sub-state source code information, obtain each of the sub-state source code information.

[0120] S724, determine the corresponding sub-state complement information based on the original code information of each sub-state.

[0121] S726, determine the sub-state information based on the sub-state complement information.

[0122] S728, concatenate multiple sub-state information to obtain data state information corresponding to the data identification information.

[0123] For specific implementation methods and limitations in this embodiment, please refer to the above embodiments, which will not be repeated here.

[0124] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0125] Based on the same inventive concept, this disclosure also provides an information storage device for implementing the information storage method described above. The solution provided by this device is similar to the solution described in the above method; therefore, specific limitations in one or more information storage device embodiments provided below can be found in the limitations of the information storage method described above, and will not be repeated here.

[0126] In one embodiment, such as Figure 10 As shown, an information storage device 800 is provided, including: an information acquisition module 802, an information processing module 804, a variable determination module 806, and a storage module 808, wherein:

[0127] Information acquisition module 802 is used to acquire data identification information to be stored and data status information corresponding to the data identification information, wherein the data status information includes: system tag information described by Boolean variables;

[0128] Information processing module 804 is used to determine the original code information of the status corresponding to the data status information using the data status information as complement;

[0129] The variable determination module 806 is used to determine the integer variable to be stored corresponding to the state source code information;

[0130] The storage module 808 is used to store the integer variable to be stored and the data identification information to be stored.

[0131] In one embodiment of the device, the device further includes: a data information acquisition module, configured to, in response to the need to acquire data status information corresponding to the data identification information, acquire the integer variable to be stored corresponding to the identification information based on the data identification information.

[0132] The original code data determination module is used to determine the original code data corresponding to the integer variable to be stored.

[0133] The data status information determination module is used to determine the complement data corresponding to the original code data, and to determine the data status information corresponding to the data identifier information based on the complement data.

[0134] In one embodiment of the device, the device further includes: a padding module, configured to pad the original code data in response to the fact that the bit width of the original code data is less than the bit width of the data status information, and the bit width of the data status information is less than or equal to 32 bytes, so that the bit width of the padded original code data is equal to the bit width of the data status information.

[0135] The data status information determination module is also used to determine the corresponding complement data based on the original code data obtained after padding.

[0136] In one embodiment of the device, the variable determination module 806 is further configured to convert the original code information of the status into a corresponding integer variable to be stored in response to the data status information having a bit width of less than or equal to 32 bytes.

[0137] In one embodiment of the device, the variable determination module 806 includes:

[0138] The data partitioning module is used to divide the data status information according to a preset first bit width in response to the data status information having a bit width greater than 32 bytes, thereby obtaining multiple sub-status information, wherein the first bit width is 32 bytes.

[0139] The sub-state determination module is used to determine the original code information of the sub-state corresponding to each of the sub-state information by using the complement of each sub-state information.

[0140] In one embodiment of the device, the data state information determination module is further configured to, in response to the existence of multiple sub-state source code information, acquire each sub-state source code information; determine the corresponding sub-state complement information based on each sub-state source code information; determine sub-state information based on the sub-state complement information; and concatenate multiple sub-state information to obtain data state information corresponding to the data identification information.

[0141] Each module in the aforementioned information storage device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0142] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 11As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores integer variables and data identification information. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements an information storage method.

[0143] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the computer device to which the present disclosure is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0144] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in any of the above method embodiments.

[0145] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in any of the above method embodiments.

[0146] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.

[0147] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this disclosure may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this disclosure may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0148] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0149] The embodiments described above are merely illustrative of several implementations of this disclosure, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent disclosure. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this disclosure, and these all fall within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the appended claims.

Claims

1. An information storage method characterized by, The method comprises: acquiring data identification information to be stored and data state information corresponding to the data identification information, the data state information comprising system mark information described by a Boolean variable; in response to a bit width of the data state information being greater than 32 bytes, dividing the data state information according to a preset first bit width to obtain a plurality of sub-state information, the first bit width being 32 bytes; determining sub-state original code information corresponding to each of the sub-state information by taking each of the sub-state information as a complement; in response to the bit width of the data state information being less than or equal to 32 bytes, converting the state original code information into a corresponding to-be-stored integer variable; storing the to-be-stored integer variable and the data identification information to be stored; in response to a need to acquire data state information corresponding to the data identification information, acquiring the to-be-stored integer variable corresponding to the identification information according to the data identification information; determining original code data corresponding to the to-be-stored integer variable; determining complement data corresponding to the original code data, in response to a plurality of sub-state original code information existing, acquiring each of the sub-state original code information; determining corresponding sub-state complement information according to each of the sub-state original code information; determining sub-state information according to the sub-state complement information; and splicing a plurality of the sub-state information to obtain data state information corresponding to the data identification information.

2. The method of claim 1, wherein, After the determination of the sub-state original code information corresponding to each of the sub-state information, the method further comprises: in response to a bit width of the original code data being less than a bit width of the data state information and the bit width of the data state information being less than or equal to 32 bytes, performing bit padding on the original code data, so that a bit width of the original code data obtained after the bit padding is equal to the bit width of the data state information; correspondingly, the determination of the complement data corresponding to the original code data comprises: determining the complement data corresponding to the original code data obtained after the bit padding.

3. An information storage device, characterized by comprising: The apparatus comprises: an information acquisition module configured to acquire data identification information to be stored and data state information corresponding to the data identification information, the data state information comprising system mark information described by a Boolean variable; an information processing module configured to, in response to a bit width of the data state information being greater than 32 bytes, divide the data state information according to a preset first bit width to obtain a plurality of sub-state information, the first bit width being 32 bytes; and determine sub-state original code information corresponding to each of the sub-state information by taking each of the sub-state information as a complement; a variable determination module configured to, in response to the bit width of the data state information being less than or equal to 32 bytes, convert the state original code information into a corresponding to-be-stored integer variable; a storage module configured to store the to-be-stored integer variable and the data identification information to be stored; a data information acquisition module configured to, in response to a need to acquire data state information corresponding to the data identification information, acquire the to-be-stored integer variable corresponding to the identification information according to the data identification information; determine original code data corresponding to the to-be-stored integer variable; and determine complement data corresponding to the original code data, The data state information determination module is further configured to, in response to the existence of multiple sub-state original code information, acquire each sub-state original code information; determine corresponding sub-state complement information according to each sub-state original code information; determine sub-state information according to the sub-state complement information; splice multiple sub-state information to obtain data state information corresponding to the data identification information.

4. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 2.

5. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 2.

6. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 2. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 2.

Citation Information

Patent Citations

  • Matrix data scatter and gather by row

    CN113849770A

  • Accelerator and electronic equipment

    CN113961506A