Boolean data storage method and device, computer equipment and storage medium

By customizing the number of bit fields and the number of bit fields in the data unit, and creating containers based on the number of Boolean data in the configuration table, the problem of wasted storage space and performance impact in the traditional Boolean data storage method is solved, and flexible storage and efficient data are achieved. operate.

CN118733002AActive Publication Date: 2024-10-01HUNAN TACHYON CULTURE & TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410775414.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-01
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

Traditional Boolean data storage methods waste storage space when faced with large amounts of data, and cannot flexibly match the actual amount of data, resulting in performance impact and data loss.

Method used

Create containers to match the actual data volume by customizing the number of bit fields and the number of each data unit based on the amount of Boolean data in the configuration table, and store and operate based on the index number and index value.

Benefits of technology

It achieves flexible storage capacity configuration, reduces storage space waste, and improves data access efficiency and operational convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733002A_ABST
    Figure CN118733002A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a Boolean data storage method and device, computer equipment and a storage medium. Based on the number of Boolean data in a configuration table, the number of bit fields capable of being stored in each data unit and the number of the data units are self-defined; therefore, the quantity of Boolean data which can be stored in the created container is matched with the quantity of Boolean data in the actual configuration table, the storable capacity of the container can be flexibly set based on project requirements, and the Boolean data is stored in the data unit based on the index number of the data unit and the index value corresponding to the Boolean data. And subsequent operations such as access to the Boolean data are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a Boolean data storage method, device, computer equipment and storage medium. Background Art

[0002] In software development, processing and compressing data is very critical, especially when it comes to large amounts of data. Boolean data types are usually used for storage and judgment, because Boolean data usually only contains two states: true or false. For example, in a project, if you need to know how many subordinate organizations there are in the current superior organization, you only need to make a judgment based on the state of existence or not.

[0003] The traditional Boolean storage method is that one byte of Boolean is 8 bits. When faced with storing a large amount of Boolean data, a lot of storage space will be wasted, and performance may be affected when a large amount of Boolean data is accessed. If a bit field storage method based on binary operations is adopted, that is, one Boolean value is stored in each bit, although the storage space of Boolean data is saved, the maximum number of Boolean data that can be stored must be determined in advance, which cannot be matched with the number of Boolean data in the configuration table corresponding to the actual superior organization. If the estimated number of Boolean values ​​is too large, unnecessary storage space will be wasted. If the estimated number of Boolean values ​​is insufficient, Boolean data may be lost, which is not flexible enough for project requirements. Summary of the invention

[0004] In view of this, the present invention provides a Boolean data storage method, apparatus, computer device and storage medium to solve the problem that the maximum amount of Boolean data that can be stored is determined in advance and cannot be matched with the amount of Boolean data in the configuration table corresponding to the actual superior organization.

[0005] In a first aspect, the present invention provides a Boolean data storage method, the method comprising: in response to a user's storage instruction for a first configuration table, determining the number of bit field bits that can be stored in each data unit and a target number of data units based on the number of Boolean data in the first configuration table, wherein each bit in the data unit represents a Boolean data in the first configuration table, and the number of Boolean data that can be stored in the target number of data units is greater than the number of Boolean data in the first configuration table; creating a first container corresponding to the first configuration table, assigning a corresponding index number to each data unit, and based on the index number corresponding to the data unit and the index value corresponding to the Boolean data in the first configuration table, storing the Boolean data in the first configuration table in sequence in the corresponding data units, the first container including the target number of data units.

[0006] The Boolean data storage method provided in this embodiment customizes the number of bit field bits and the number of data units that can be stored in each data unit based on the number of Boolean data in the configuration table, so that the number of Boolean data that can be stored in the created container matches the number of Boolean data in the actual configuration table, thereby realizing that the storage capacity of the container can be flexibly set based on project requirements, and the Boolean data is stored in the data unit based on the index number of the data unit and the index value corresponding to the Boolean data, so as to facilitate subsequent operations such as access to the Boolean data.

[0007] In an optional embodiment, the bit field bit number includes multiple bit numbers, and based on the number of Boolean data in the first configuration table, the bit field bit number that can be stored in each data unit and the target number of data units are determined, including: based on the number of Boolean data in the first configuration table, determining the number of data units corresponding to each bit field bit; calculating the product value of each bit field bit and the corresponding number of data units, and calculating the difference between the product value and the number of Boolean data in the first configuration table; selecting the bit field bit number and the number of data units corresponding to the minimum difference as the bit field bit number and the target number of data units that can be stored in each data unit.

[0008] The present invention takes into account that different bit field bits correspond to different numbers of data units, and the container capacities allocated are also different. Therefore, under the premise that the container capacity is greater than the number of Boolean data in the configuration table, the bit field bit number and the number of data units with the smallest difference from the number of Boolean data can be selected to ensure that no excessive memory space is wasted.

[0009] In an optional embodiment, the method further includes: responding to a user's operation instruction on the target Boolean data, determining the data unit position of the target Boolean data based on the index value of the target Boolean data and the index number corresponding to each data unit, reading the state of the data unit position of the target Boolean data, and performing a bit operation based on the state of the target Boolean data.

[0010] The present invention determines the position of the data unit where the target Boolean data is located based on the index value of the Boolean data and the index number of the data unit, and performs corresponding bit operations, thereby improving the efficiency of searching and operating the target Boolean data.

[0011] In an optional embodiment, the method further includes: determining whether the first decimal value corresponding to the current data unit in the container is greater than zero, and if greater than zero, subtracting one from the first decimal value and performing an AND operation with the current data unit to obtain a new data unit; performing an XOR operation on the Boolean data in the new data unit and the Boolean data in the current data unit to obtain an XOR operation result, and calculating a second decimal value corresponding to the XOR operation result, and determining the second decimal value as the position of the Boolean data in the true state in the current data unit; calculating the position of the Boolean data in the true state in the first container based on the index number, the number of bits in the bit field and the position of the Boolean data in the true state corresponding to the current data unit in the current data unit; updating the data unit after the first decimal value is subtracted from one as the current data unit, and repeatedly performing the step of determining whether the first decimal value corresponding to the current data unit in the container is greater than zero, until the first decimal value of the current data unit is equal to zero; and then looping to the next data unit in the container. After traversing all data units in the container, the number of all Boolean data in the true state and their respective positions in the container are determined.

[0012] The present invention can clearly know the state of each Boolean data bit in each data unit by circulating the data units in the same container, and then clearly know the state, location and quantity of each Boolean data bit in the container, i.e., the configuration table.

[0013] In an optional implementation, index numbers are assigned to data units in each container in the same manner as the index number assignment of the data unit, and the method further includes: obtaining a first data unit in the first container and a second data unit in the second container, performing a bit operation on the Boolean data in the first data unit and the Boolean data in the second data unit, the index numbers corresponding to the first data unit and the second data unit are the same, and the number of bits of the bit field that can be stored in the data units in the first container and the second container is the same; if there is no Boolean data at the current position of the first data unit in the first container, but there is Boolean data at the same position of the second data unit in the second container, the Boolean data at the current position of the first data unit is assumed to be in a false state, and a bit operation is performed on the Boolean data at the same position of the second data unit.

[0014] In addition to adding, deleting, modifying and checking single Boolean data in a general sense, the present invention also supports the modification of Boolean values ​​of the entire container, avoiding the tedious calling of index values ​​when modifying single Boolean data, and greatly improving the efficiency and convenience of data operations.

[0015] In an optional implementation, the bitwise operation on the Boolean data in the first data unit and the Boolean data in the second data unit includes: performing a logical OR operation on the Boolean data in the first data unit and the Boolean data in the second data unit, assigning the logical OR operation result to the first data unit, traversing all data units in the first container and all data units in the second container to obtain a new first container, or performing a logical AND operation on the Boolean data in the first data unit and the Boolean data in the second data unit, comparing the logical AND operation result with the Boolean data in the second data unit, judging whether the Boolean data set existing in the first data unit includes the Boolean data set existing in the second data unit, traversing all data units in the first container and all data units in the second container, judging whether the Boolean data set existing in the first container includes the Boolean data set existing in the second container, wherein the existing Boolean data represents Boolean data in a true state, Or, perform a logical exclusive OR operation on the Boolean data in the first data unit and the Boolean data in the second data unit, assign the logical exclusive OR operation result to the first data unit, traverse all data units in the first container and all data units in the second container, and update the first container; perform a logical exclusive OR operation on the Boolean data of the first data unit in the updated first container and the Boolean data of the second data unit, assign the logical exclusive OR operation result to the second data unit, traverse all data units in the first container and all data units in the second container, and update the second container; perform a logical exclusive OR operation on the Boolean data of the first data unit in the updated first container and the Boolean data of the second data unit in the updated second container, assign the logical exclusive OR operation result to the first data unit, traverse all data units in the first container and all data units in the second container, and update the first container again to exchange the Boolean data in the first container with the Boolean data in the second container.

[0016] The present invention performs AND operations between containers based on project requirements to realize the function of judging whether a container contains the Boolean data of another container, performs bit operations between containers to realize the function of a certain container swallowing up the Boolean data of another container, and performs XOR operations between containers to realize the function of exchanging Boolean data of two containers and reversing the Boolean data in the containers.

[0017] In an optional embodiment, the method further includes: in response to a container generation instruction operated by a user, determining the number of data units based on the number of Boolean data in the second configuration table in the container generation instruction and the number of bit field bits that can be stored in each data unit; creating a container consisting of a corresponding number of data units in the second configuration table, matching the index value corresponding to the first Boolean data in the second configuration table with the position of the data unit corresponding to the starting index number based on the offset in the container generation instruction, and storing the Boolean data in the second configuration table in sequence, or, in response to a user update instruction for the first configuration table, judging whether the number of Boolean data that can be stored in the current target number of data units is greater than the number of Boolean data updates based on the number of Boolean data updates in the first configuration table in the update instruction; if the number of Boolean data that can be stored in the current target number of data units is not greater than the number of Boolean data updates, re-determining the number of bit field bits that can be stored in each data unit and the number of data units, and based on the re-determined number of bit field bits that can be stored in each data unit, storing the Boolean data in the first configuration table in the re-determined data units.

[0018] In order to improve the development efficiency of developers, the present invention provides the function of manually generating Grids or repairing Grids in the editor. Through an intuitive interface display, it can build and repair Boolean data containers corresponding to a reasonable memory size according to the configuration table during development, reducing the workload of developers and greatly improving the development speed and convenience.

[0019] In a second aspect, the present invention provides a Boolean data storage device, the device comprising: a storage unit determination module, for responding to a user's storage instruction for a first configuration table, and determining the number of bit field bits that can be stored in each data unit and a target number of data units based on the number of Boolean data in the first configuration table, wherein each bit in the data unit represents a Boolean data in the first configuration table, and the number of Boolean data that can be stored in the target number of data units is greater than the number of Boolean data in the first configuration table; a data storage module, for assigning a corresponding index number to each data unit, and based on the index number corresponding to the data unit and the index value corresponding to the Boolean data in the first configuration table, storing the Boolean data in the first configuration table in sequence in the corresponding data unit.

[0020] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the Boolean data storage method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0021] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the Boolean data storage method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 is a schematic flow chart of a Boolean data storage method according to an embodiment of the present invention;

[0024] Figure 2 is a flow chart of another Boolean data storage method according to an embodiment of the present invention;

[0025] Figure 3 is an example diagram of a process of Boolean data processing according to an embodiment of the present invention;

[0026] Figure 4 is an example diagram of an editor interface according to an embodiment of the present invention;

[0027] Figure 5 is a structural block diagram of a Boolean data storage device according to an embodiment of the present invention;

[0028] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0030] In software development, processing and compressing data is very critical, especially when it comes to large amounts of data; for example, in a project, you need to know how many subordinate organizations (specific organizational entities) there are in a parent organization (the container array abstraction in this project). Without involving other things, you only need to make a judgment on whether it exists or not, and usually use the Boolean data type for storage judgment. Because Boolean data usually only contains two states: true or false, but when faced with a large number of organizational Boolean value judgments, using traditional Boolean storage methods will not only waste a lot of space (Boolean is 8 bits per byte), but may also affect performance when accessing large amounts of data. In order to store these Boolean data more efficiently, a high-performance method for compressing Boolean data is needed.

[0031] In order to optimize the storage and read access of large amounts of Boolean data, we designed a general composite data structure that combines high performance, development convenience, and code readability. This structure combines the efficient memory efficiency and access speed of bit fields based on binary operations, renumbers arrays with bit fields as elements, and encapsulates them into Grids for easy reading and writing. The code data structure is reasonable and easy to read.

[0032] According to an embodiment of the present invention, a Boolean data storage method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0033] In this embodiment, a Boolean data storage method is provided, which can be used in the above-mentioned computer device. Figure 1 is a flowchart of a Boolean data storage method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0034] Step S101 , in response to a user's storage instruction for a first configuration table, the number of bit field bits that can be stored in each data unit and the target number of data units are determined based on the number of Boolean data in the first configuration table.

[0035] Each bit in the data unit represents a Boolean data in the first configuration table, and the number of Boolean data that can be stored in the target number of data units is greater than the number of Boolean data in the first configuration table.

[0036] In an embodiment of the present invention, the number of bit fields that can be stored in each data unit can be set in advance to 32 bits or 64 bits. When the Boolean data of the configuration table is subsequently stored, the target number of data units can be fixedly calculated according to the preset number of bit fields. Taking 32 bits as an example, after responding to the user's storage instruction for the first configuration table, the number of Boolean data in the first configuration table can be obtained. For example, there are 70 Boolean data in the first configuration table. Based on the preset number of bit fields that can be stored in each data unit of 32 bits, the target number of data units can be determined to be 70 / 32=3 (rounded up), and the number of data units can be determined to be 3. The target number of data units generally determined is the minimum number value of the number of Boolean data that can be stored in the target number of data units greater than the number of Boolean data in the first configuration table, ensuring that the amount of Boolean data that can be stored in the container does not cause too much waste of storage space, and the capacity of the created container can be determined to be 3*32=96. This is only used as an example and is not limited.

[0037] Step S102, create a first container corresponding to the first configuration table, assign a corresponding index number to each data unit, and based on the index number corresponding to the data unit and the index value corresponding to the Boolean data in the first configuration table, store the Boolean data in the first configuration table in the corresponding data unit in sequence.

[0038] The first container includes a target number of data units.

[0039] The embodiment of the present invention can initialize and create a container based on the first configuration table, which can be represented by Grids and used to manage a determined target number of data units, wherein each data unit can be represented by a Grid, and each data unit can be assigned a corresponding unique Grid index number, such as assigning numbers item0, item1, item2... in sequence. As an example only, the index values ​​corresponding to all Boolean data in the first configuration table are parsed to ensure that only 32-bit Boolean data can be stored in each data unit, and the index value corresponding to each Boolean data is divided by 32 to obtain the quotient and remainder, where the quotient represents the index number of the stored data unit, and the remainder represents the position of the stored data unit, so that the indexer can be used to read, write and locate the data. For example, the index value of the Boolean data is 72, 72 / 32≈2, 72%32=8, so it can be determined that the index number of the stored data unit is 2, which is the 8th low bit in the bit field of item2. This is only an example and is not limited to this.

[0040] The Boolean data storage method provided in this embodiment customizes the number of bit field bits and the number of data units that can be stored in each data unit based on the number of Boolean data in the configuration table, so that the number of Boolean data that can be stored in the created container matches the number of Boolean data in the actual configuration table, thereby realizing that the storage capacity of the container can be flexibly set based on project requirements, and the Boolean data is stored in the data unit based on the index number of the data unit and the index value corresponding to the Boolean data, so as to facilitate subsequent operations such as access to the Boolean data.

[0041] In this embodiment, a Boolean data storage method is provided, which can be used in the above-mentioned computer device. Figure 2 is a flowchart of a Boolean data storage method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0042] Step S201, in response to a user's storage instruction for the first configuration table, the number of bit field bits that can be stored in each data unit and the target number of data units are determined based on the number of Boolean data in the first configuration table.

[0043] The bit field number includes multiple bit numbers. Specifically, the above step S201 includes:

[0044] Step S2011, based on the number of Boolean data in the first configuration table, determine the number of data units corresponding to each bit field number.

[0045] The bit number of the bit field of the embodiment of the present invention may include 8 bits, 16 bits, 32 bits and 64 bits. As an example only, it can be updated in real time according to the bit number of the data type in the existing C#. It is not limited. According to the number of Boolean data in different configuration tables of the project, a suitable bit field can be selected as the basic data storage unit. The number of data units corresponding to different bit field bits will change accordingly. After responding to the storage instruction of the first configuration table, the number of data units corresponding to different bit field bits can be calculated based on the number of Boolean data in the configuration table. For example, if there are 70 Boolean data in the first configuration table, the number of data units corresponding to the 8-bit bit field can be calculated as 9, the number of data units corresponding to the 16-bit bit field is 5, the number of data units corresponding to the 32-bit bit field is 3, and the number of data units corresponding to the 64-bit bit field is 2, as an example only.

[0046] Step S2012, calculate the product of the number of bits in each bit field and the number of corresponding data units, and calculate the difference between the product value and the number of Boolean data in the first configuration table, wherein the number of data units is the minimum value that makes the product value greater than the number of Boolean data in the first configuration table.

[0047] The embodiment of the present invention can calculate the product of the number of bits in each bit field and the number of corresponding data units, for example, 8*9=72bit, corresponding to the difference of 2 in the number of Boolean data in the first configuration table, 16*5=80bit, corresponding to the difference of 10 in the number of Boolean data in the first configuration table, 32*3=96bit, corresponding to the difference of 26 in the number of Boolean data in the first configuration table, 64*2=128bit, corresponding to the difference of 58 in the number of Boolean data in the first configuration table, for example only.

[0048] Step S2013: Select the number of bit field bits and the number of data units corresponding to the minimum difference value as the number of bit field bits that can be stored in each data unit and the target number of data units.

[0049] The embodiment of the present invention may select the number of bit field bits and the number of data units corresponding to the minimum difference as the number of bit field bits that can be stored in each data unit and the target number of data units, that is, select 8 fields and 9 data units corresponding to 72, as an example only.

[0050] The present invention takes into account that different bit field bits correspond to different numbers of data units, and the container capacities allocated are also different. Therefore, under the premise that the container capacity is greater than the number of Boolean data in the configuration table, the bit field bit number and the number of data units with the smallest difference from the number of Boolean data can be selected to ensure that no excessive memory space is wasted.

[0051] Step S202: Create a first container corresponding to the first configuration table, assign a corresponding index number to each data unit, and store the Boolean data in the first configuration table in the corresponding data unit in sequence based on the index number corresponding to the data unit and the index value corresponding to the Boolean data in the first configuration table. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0052] Step S203, in response to the user's operation instruction on the target Boolean data, based on the index value of the target Boolean data and the index number corresponding to each data unit, determine the data unit position where the target Boolean data is located, read the state of the data unit position where the target Boolean data is located, and perform a bit operation based on the state of the target Boolean data.

[0053] When the embodiment of the present invention performs addition, deletion, modification and query of Boolean data, a series of auxiliary functions can be defined to handle bit logic operations. These functions will accept the size of the Boolean data index value as a parameter and perform corresponding bit operations, wherein there is no limitation on what specific operations the bit operations include, such as reading Boolean values, changing or clearing Booleans. For example, for reading Boolean values, the number of bits in the bit field can be divided according to the index value corresponding to the target Boolean data to calculate the index number of the data unit and the remainder can be calculated to calculate the position in the data unit. Finally, the Boolean state of the position can be directly read to determine the Boolean value of the target Boolean data, that is, the Boolean state.

[0054] like Figure 3 As shown, for modifying or clearing Boolean values, the Grid index number and data unit position can also be calculated based on the index value corresponding to the target Boolean data, and bit operations (such as bitwise AND, bitwise OR, bitwise inversion, etc.) can be used to modify the state of the target Boolean data. For example, the current organization is planning the index value of 120 (data that has been corrected by the Gridid ​​offset), first divide (data type System.UInt32) to get the Grid number 4 (rounded up), and then take the remainder to get 24; so the addition, deletion, modification and query are performed on the Grid number 4, and the binary data changes are performed on the 24th bit of the 32-bit binary, just as an example.

[0055] The present invention determines the position of the data unit where the target Boolean data is located based on the index value of the Boolean data and the index number of the data unit, and performs corresponding bit operations, thereby improving the efficiency of searching and operating the target Boolean data.

[0056] In one embodiment, it is determined whether the first decimal value corresponding to the current data unit in the container is greater than zero. If it is greater than zero, the first decimal value is decremented by one and then ANDed with the current data unit to obtain a new data unit; the Boolean data in the new data unit is XORed with the Boolean data in the current data unit to obtain the XOR result, and the second decimal value corresponding to the XOR result is calculated, and the second decimal value is determined as the position of the Boolean data in the true state in the current data unit; based on the index number, the number of bits in the bit field and the position of the Boolean data in the true state in the current data unit corresponding to the current data unit, the position of the Boolean data in the true state in the first container is calculated; the data unit after the first decimal value is decremented by one is updated as the current data unit, and the step of determining whether the first decimal value corresponding to the current data unit in the container is greater than zero is repeatedly performed until the first decimal value of the current data unit is equal to zero; then the next data unit of the container is looped. All data units in the container are traversed to determine the number of all Boolean data in the true state and their respective positions in the container.

[0057] The embodiment of the present invention can obtain the first Grid of the Grids container, that is, the data unit with index number zero, calculate the corresponding decimal value based on the Boolean data stored in the current data unit, and determine whether the decimal value is greater than zero. If the decimal value is greater than zero, it means that the data unit has Boolean data in the true state. Then, the decimal value corresponding to the current data unit can be processed by subtracting one for the first time (including the Boolean data after the subtraction process), and then AND operation can be performed with the current data unit to obtain a new data unit newGrid. The Boolean data in the new data unit and the Boolean data in the current data unit can be XORed to obtain the XOR result (including the Boolean data after the XOR operation), and the decimal value corresponding to the XOR result can be calculated. The decimal value can be determined as the position (BitPos) of the Boolean data in the current cycle in the true state in the data unit. And the index number of the data unit * the number of bits in the bit field + BitPos can be calculated to determine the position of the Boolean data in the true state in the container.

[0058] The data unit after the first decimal subtraction process can be subtracted by one twice to obtain a third data unit, and it is determined whether the decimal value corresponding to the third data unit after the second subtraction process is greater than zero. If it is still greater than zero, it means that there is still Boolean data in the data unit in a true state. The data unit can be ANDed with the data unit after the first subtraction process to obtain a fourth data unit. The Boolean data in the fourth data unit can be XORed with the data unit after the first subtraction process to obtain an XOR result. The decimal value corresponding to the XOR result is calculated, and the decimal value can be used as the position of the Boolean data in the true state of the current cycle in the data unit, and then the position in the container is calculated. For detailed description, refer to the above embodiment. The loop is continued until the decimal value corresponding to the data unit after the data unit with index number zero is subtracted by one for multiple times is zero, indicating that there is no Boolean data in the current data unit in a true state. The position of the Boolean data in the true state in each loop and the total number of loops are counted as the number of Boolean data in the true state in the data unit, which is only used as an example.

[0059] After the loop of the data unit with index number zero ends, the data unit with index number 1 can be obtained to determine the location and number of all Boolean data in the true state in the data unit with index number 1, until all data units in the container are traversed, and the location and number of all Boolean data in the true state in the container are statistically obtained.

[0060] The present invention can clearly know the state of each Boolean data bit in each data unit by circulating the data units in the same container, and then clearly know the state, location and quantity of each Boolean data bit in the container, i.e., the configuration table.

[0061] In one embodiment, a first data unit in a first container and a second data unit in a second container are obtained, and a bit operation is performed on the Boolean data in the first data unit and the Boolean data in the second data unit. If there is no Boolean data at a current position of the first data unit in the first container, but there is Boolean data at the same position of the second data unit in the second container, the Boolean data at the current position of the first data unit is assumed to be in a false state, and a bit operation is performed on the Boolean data at the same position of the second data unit.

[0062] The data units in each container are assigned index numbers in the same data unit index number assignment manner, the first data unit and the second data unit have the same index numbers, and the number of bit fields that can be stored in the data units in the first container and the second container is the same.

[0063] An embodiment of the present invention obtains a first data unit in a first container and a second data unit in a second container, and may perform a bit operation on the Boolean data in the first data unit and the Boolean data in the second data unit to obtain a bit operation result, wherein the bit operation method is not limited, and may be an AND operation, an OR operation, or an XOR operation. As an example only, the obtained bit operation result may recreate a container for storing the bit operation result, so as to facilitate subsequent comparison of the relationship between the first container and the second container, and may also be based on the actual required amplitude to the first data unit or the second data unit to implement the update of the data unit.

[0064] In the process of performing bit operations between data units in the embodiment of the present invention, it may happen that the Boolean data stored in the first container is less than the Boolean data stored in the second container, resulting in no Boolean data at a certain position in the first data unit, but there is Boolean data at the same position in the second data unit. In this case, the state of the Boolean data at that position in the first data unit may be assumed to be a false state, and then the bit operation is performed with the Boolean data at the same position in the second data unit, for example only.

[0065] In addition to adding, deleting, modifying and checking single Boolean data in a general sense, the present invention also supports the modification of Boolean values ​​of the entire container, avoiding the tedious calling of index values ​​when modifying single Boolean data, and greatly improving the efficiency and convenience of data operations.

[0066] Specifically, performing a bit operation on the Boolean data in the first data unit and the Boolean data in the second data unit includes:

[0067] Performing a logical OR operation on the Boolean data in the first data unit and the Boolean data in the second data unit, assigning the logical OR operation result to the first data unit, traversing all the data units in the first container and all the data units in the second container to obtain a new first container, or,

[0068] In the embodiment of the present invention, when organizations (entity organizations of container Grids, data types are still containers, but bit field Boolean data has a specific meaning) are merged, one organization swallows all subordinate organizations of another organization, so the Boolean value contained therein is not a single one. In order to reduce the amount of code, the or operator is overloaded, and the two entity organization Grids (that is, a single Grid / data unit each time) are traversed to perform or operations and assign values; the overloaded or operator is automatically called, and the organization realizes the Boolean data change of swallowing up another organization.

[0069] like Figure 3 As shown, a logical OR operation can be performed on the Boolean data in the first data unit of the first container and the Boolean data in the second data unit of the second container, and the result of the logical OR operation is assigned to the first data unit. All data units in the first container and the second container are traversed, and the results of the logical OR operation are assigned to the data units corresponding to the first container. A new first container can be obtained, and the Boolean data change of the first container absorbing the second container is realized.

[0070] For example: for two different entities organized in the same container (such as Grids1 and Grids2), Grids1 needs to merge all meaningful Boolean values ​​in Grids2. First, traverse the size of Grids2 (the data types of Grids1 and Grids2 are consistent and traversed at the same time). Each time is a Grid (data unit / bit field). The Grid1 and Grid2 corresponding to the traversal of Grids1 and Grids2 respectively are ORed. At this time, general binary operations are performed on the two bit fields, and the Boolean value symbolizing possession in Grid2 is set to 1. The OR operation is assigned to Grid1, and the traversal is completed; that is, the function of merging Grids1 with Grids2 is completed.

[0071] Perform a logical AND operation on the Boolean data in the first data unit and the Boolean data in the second data unit, compare the logical AND operation result with the Boolean data in the second data unit, determine whether the Boolean data set existing in the first data unit includes the Boolean data set existing in the second data unit, traverse all data units in the first container and all data units in the second container, determine whether the Boolean data set existing in the first container includes the Boolean data set existing in the second container, the existing Boolean data represents Boolean data whose state is true, or,

[0072] like Figure 3As shown, in an embodiment of the present invention, a logical AND operation can be performed on the Boolean data in the first data unit in the first container and the Boolean data in the second data unit in the second container, and the result of the logical AND operation can be compared with the Boolean data in the second data unit. If the result of the logical AND operation is consistent with the Boolean data in the second data unit, it means that the Boolean data set existing in the first data unit includes the Boolean data set existing in the second data unit. If the Boolean data in any position is inconsistent, it means that the Boolean data set existing in the first data unit does not include the Boolean data set existing in the second data unit. For example, if the Boolean data in the first data unit is 110 and the Boolean data in the second data unit is 100, the first data unit and the second data unit are performed. After the AND operation, the AND operation result is 100. The AND operation result 100 is compared with the second data unit 100. It is found that the Boolean data are consistent, which means that the Boolean data set existing in the first data unit includes the Boolean data set existing in the second data unit. Just as an example, all data units in the first container and all data units in the second container are traversed. If it is determined that each data unit in the first container includes the corresponding data unit in the second container, it means that the Boolean data set existing in the first container includes the Boolean data set existing in the second container. If there is a data unit that is determined not to include the corresponding data unit in the second container, it is determined that the Boolean data set existing in the first container does not include the Boolean data set existing in the second container.

[0073] Perform a logical exclusive OR operation on the Boolean data in the first data unit and the Boolean data in the second data unit, assign the logical exclusive OR operation result to the first data unit, traverse all the data units in the first container and all the data units in the second container, and update the first container; perform a logical exclusive OR operation on the Boolean data of the first data unit in the updated first container and the Boolean data of the second data unit, assign the logical exclusive OR operation result to the second data unit, traverse all the data units in the first container and all the data units in the second container, and update the second container; perform a logical exclusive OR operation on the Boolean data of the first data unit in the updated first container and the Boolean data of the second data unit in the updated second container, assign the logical exclusive OR operation result to the first data unit, traverse all the data units in the first container and all the data units in the second container, and update the first container again to exchange the Boolean data in the first container with the Boolean data in the second container.

[0074] like Figure 3As shown, the embodiment of the present invention can perform an XOR operation on the Boolean data in the first data unit in the first container and the Boolean data in the second data unit in the second container, and assign the XOR result to the first data unit, traverse all the data units in the first container and all the data units in the second container to obtain an updated first container; perform an XOR operation on the Boolean data of the first data unit in the updated first container and the Boolean data of the second data unit in the second container, and assign the XOR result to the second data unit, traverse all the data units in the first container and all the data units in the second container to update the second container. At this time, the Boolean data in the second container is the same as the Boolean data of the initial first container.

[0075] An XOR operation is performed on the Boolean data of the updated first data unit in the first container and the Boolean data of the updated second data unit in the second container, and the XOR operation result is assigned to the first data unit again, and all data units in the first container and the second container are traversed, and the first container is updated again. At this time, the Boolean data in the first container is the same as the initial Boolean data in the second container, so that the interaction of the contents of the two containers is realized, and there is no need to use an additional container for storage, thereby improving the efficiency of Boolean data operations.

[0076] In one embodiment, if it is necessary to reverse the Boolean data of the second and third bits in the first container, an empty container may be created, and then the second and third bits of the empty container may be assigned a value of 1, and then the empty container may be XORed with the Boolean data in the first container, thereby flipping the Boolean data of the second and third bits in the first container, that is, changing the original Boolean data from 0 to 1, and from 1 to 0. This is only an example and is not intended to be limiting.

[0077] The present invention performs AND operations between containers based on project requirements to realize the function of judging whether a container contains the Boolean data of another container, performs bit operations between containers to realize the function of a certain container swallowing up the Boolean data of another container, and performs XOR operations between containers to realize the function of exchanging Boolean data of two containers and reversing the Boolean data in the containers.

[0078] In one embodiment, in response to a container generation instruction operated by a user, the number of data units is determined based on the number of Boolean data in the second configuration table in the container generation instruction and the number of bit fields that can be stored in each data unit; a container consisting of a corresponding number of data units in the second configuration table is created, and based on the offset in the container generation instruction, the index value corresponding to the first Boolean data in the second configuration table is matched with the position of the data unit corresponding to the starting index number, and the Boolean data in the second configuration table is stored in sequence, or,

[0079] like Figure 4As shown, the container generation instruction of the embodiment of the present invention may include the container script name, the number of Boolean data input according to the project configuration table (i.e., the capacity requirement for BitGrid), and because the position number corresponding to the 32-bit data unit in a general container is 0-31, or the position number corresponding to the 64-bit data unit is 0-65, if the sequence number of the Boolean data stored in the project configuration table is 5-40, the Gridid ​​offset can be set, such as setting 5, so that the sequence number represented by the first bit of the Boolean data matches the position of the data unit.

[0080] In response to the number of bits of the bit field (i.e., the data type of the bit field), the number of Boolean data and the offset set by the user, the number of data units can be determined based on the number of Boolean data and the number of bit field bits that can be stored in each data unit, and a container consisting of the corresponding number of data units in the configuration table is created. Based on the offset, the index value corresponding to the first bit of Boolean data in the second configuration table is matched with the position of the data unit corresponding to the starting index number, and the Boolean data in the second configuration table are stored in sequence.

[0081] In response to a user's update instruction for the first configuration table, based on the number of Boolean data updates in the first configuration table in the update instruction, determine whether the number of Boolean data that can be stored in the data units of the current target number is greater than the number of Boolean data updates; if the number of Boolean data that can be stored in the data units of the current target number is not greater than the number of Boolean data updates, redetermine the number of bit field bits that can be stored in each data unit and the number of data units, and based on the redetermined number of bit field bits that can be stored in each data unit, store the Boolean data in the first configuration table in the redetermined data units.

[0082] An embodiment of the present invention responds to a user's update instruction for a configuration table, wherein the update instruction includes a script name of a container selected by the user for storage. Based on the updated number of Boolean data in the configuration table in the update instruction, it can be determined whether the number of Boolean data that can be stored in the container corresponding to the script name is greater than the updated number of Boolean data. If it is greater than the updated number of Boolean data, the updated Boolean data can be directly stored in the container. If it is not greater than the updated number of Boolean data, it is necessary to re-determine the number of bit field bits that can be stored in each data unit and the number of data units based on the number of Boolean data. Please refer to the above embodiment for detailed description, which will not be repeated here. Based on the re-determined number of bit field bits that can be stored in each data unit, the Boolean data in the first configuration table can be stored in the re-determined data unit, for example only.

[0083] In order to improve the development efficiency of developers, the present invention provides the function of manually generating Grids or repairing Grids in the editor. Through an intuitive interface display, it can build and repair Boolean data containers corresponding to a reasonable memory size according to the configuration table during development, reducing the workload of developers and greatly improving the development speed and convenience.

[0084] In this embodiment, a Boolean data storage device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0085] This embodiment provides a Boolean data storage device, such as Figure 5 As shown, including:

[0086] The storage unit determination module 501 is used to respond to the user's storage instruction for the first configuration table, and determine the number of bit field bits that can be stored in each data unit and the target number of data units based on the number of Boolean data in the first configuration table, wherein each bit in the data unit represents a Boolean data in the first configuration table, and the number of Boolean data that can be stored in the target number of data units is greater than the number of Boolean data in the first configuration table; the data storage module 502 is used to assign a corresponding index number to each data unit, and based on the index number corresponding to the data unit and the index value corresponding to the Boolean data in the first configuration table, store the Boolean data in the first configuration table in the corresponding data unit in sequence.

[0087] In some optional embodiments, the number of bit field bits includes multiple types of bit numbers, and the storage unit determination module 501 includes: a quantity calculation unit, used to determine the number of data units corresponding to each bit field bit based on the number of Boolean data in the first configuration table; a product value calculation unit, used to calculate the product value of each bit field bit and the number of data units corresponding to it, and calculate the difference between the product value and the number of Boolean data in the first configuration table; wherein the number of data units is a minimum value such that the product value is greater than the number of Boolean data in the first configuration table; a storage unit determination unit, used to select the number of bit field bits and the number of data units corresponding to the minimum difference as the number of bit field bits that can be stored in each data unit and the target number of data units.

[0088] In some optional embodiments, the Boolean data storage device also includes: a bit operation module, which is used to respond to the user's operation instructions on the target Boolean data, determine the data unit position of the target Boolean data based on the index value of the target Boolean data and the index number corresponding to each data unit, read the state of the data unit position of the target Boolean data, and perform bit operations based on the state of the target Boolean data.

[0089] In some optional embodiments, the Boolean data storage device further includes: a data unit processing module, used to determine whether the first decimal value corresponding to the current data unit in the container is greater than zero, and if greater than zero, the first decimal value is subtracted by one, and then an AND operation is performed with the current data unit to obtain a new data unit; an XOR operation module, used to perform an XOR operation on the Boolean data in the new data unit and the Boolean data in the current data unit to obtain an XOR operation result, and calculate a second decimal value corresponding to the XOR operation result, and determine the second decimal value as the position of the Boolean data in the true state in the current data unit; a position determination module, used to determine the position of the Boolean data in the true state based on the current data unit; According to the index number corresponding to the unit, the number of bits in the bit field and the position of the Boolean data in the true state in the current data unit, the position of the Boolean data in the true state in the first container is calculated; a loop position determination module is used to update the data unit after the first decimal value is reduced by one to the current data unit, and repeatedly execute the step of judging whether the first decimal value corresponding to the current data unit in the container is greater than zero, until the first decimal value of the current data unit is equal to zero; then loop to the next data unit of the container; a container traversal module is used to traverse all the data units in the container to determine the number of all the Boolean data in the true state and their respective positions in the container.

[0090] In some optional embodiments, index numbers are assigned to data units in each container in accordance with the same data unit index number assignment method, and the Boolean data storage device further includes: an inter-container bit operation module, used to obtain a first data unit in a first container and a second data unit in a second container, and perform bit operations on the Boolean data in the first data unit and the Boolean data in the second data unit, the index numbers corresponding to the first data unit and the second data unit are the same, and the number of bit fields that can be stored in the data units in the first container and the second container is the same; a data bit operation module, used to, if there is no Boolean data at the current position of the first data unit in the first container, but there is Boolean data at the same position of the second data unit in the second container, then the Boolean data at the current position of the first data unit is defaulted to a false state, and perform bit operations on the Boolean data at the same position of the second data unit.

[0091] In some optional implementations, the data bit operation module includes: an OR operation unit, which is used to perform a logical OR operation on the Boolean data in the first data unit and the Boolean data in the second data unit, assign the logical OR operation result to the first data unit, traverse all the data units in the first container and all the data units in the second container to obtain a new first container, or,

[0092] and an AND operation unit, used to perform a logical AND operation on the Boolean data in the first data unit and the Boolean data in the second data unit, compare the logical AND operation result with the Boolean data in the second data unit, determine whether the Boolean data set existing in the first data unit includes the Boolean data set existing in the second data unit, traverse all the data units in the first container and all the data units in the second container, determine whether the Boolean data set existing in the first container includes the Boolean data set existing in the second container, and the existing Boolean data represents Boolean data whose state is a true state, or,

[0093] The first XOR unit is used to perform a logical XOR operation on the Boolean data in the first data unit and the Boolean data in the second data unit, assign the result of the logical XOR operation to the first data unit, traverse all the data units in the first container and all the data units in the second container, and update the first container; the result assignment unit is used to perform a logical XOR operation on the Boolean data of the first data unit in the updated first container and the Boolean data of the second data unit, assign the result of the logical XOR operation to the second data unit, traverse all the data units in the first container and all the data units in the second container, and update the second container; the container traversal unit is used to perform a logical XOR operation on the Boolean data of the first data unit in the updated first container and the Boolean data of the second data unit in the updated second container, assign the result of the logical XOR operation to the first data unit, traverse all the data units in the first container and all the data units in the second container, and update the first container again to exchange the Boolean data in the first container with the Boolean data in the second container.

[0094] In some optional embodiments, the Boolean data storage device further includes: a container generation module, which is used to respond to a container generation instruction operated by a user, determine the number of data units based on the number of Boolean data in the second configuration table in the container generation instruction and the number of bit field bits that can be stored in each data unit; create a container consisting of a corresponding number of data units in the second configuration table, match the index value corresponding to the first Boolean data in the second configuration table with the position of the data unit corresponding to the starting index number based on the offset in the container generation instruction, and store the Boolean data in the second configuration table in sequence; or, a container repair module, which is used to respond to a user update instruction for the first configuration table, based on the number of Boolean data updates in the first configuration table in the update instruction, determine whether the number of Boolean data that can be stored in the current target number of data units is greater than the number of Boolean data updates; if the number of Boolean data that can be stored in the current target number of data units is not greater than the number of Boolean data updates, redetermine the number of bit field bits that can be stored in each data unit and the number of data units, and based on the redetermined number of bit field bits that can be stored in each data unit, store the Boolean data in the first configuration table in the redetermined data units.

[0095] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0096] The Boolean data storage device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0097] The embodiment of the present invention also provides a computer device having the above Figure 5 Boolean data storage device shown.

[0098] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0099] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0100] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0101] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0102] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0103] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0104] The input device 30 can receive input digital or character information, and generate signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0105] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0106] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A Boolean data storage method, characterized in that: The method comprises: In response to a user's instruction to store the first configuration table, based on the number of Boolean data in the first configuration table, determine the number of bit field bits that can be stored in each data unit and the target number of data units, wherein each bit in the data unit represents a Boolean data in the first configuration table, and the number of Boolean data that can be stored in the target number of data units is greater than the number of Boolean data in the first configuration table; A corresponding index number is assigned to each data unit, and based on the index number corresponding to the data unit and the index value corresponding to the Boolean data in the first configuration table, the Boolean data in the first configuration table is sequentially stored in the corresponding data unit.

2. The method according to claim 1, characterized in that The number of bit field bits includes multiple number of bits. Based on the number of Boolean data in the first configuration table, determining the number of bit field bits that can be stored in each data unit and the target number of data units includes: Determine the number of data units corresponding to each bit of each field based on the number of Boolean data in the first configuration table; Calculate the product value of the number of bits in each bit field and the number of data units corresponding to it, and calculate the difference between the product value and the number of Boolean data in the first configuration table, wherein the number of data units is the minimum value that makes the product value greater than the number of Boolean data in the first configuration table; The number of bit field bits and the number of data units corresponding to the minimum difference value are selected as the number of bit field bits that can be stored in each data unit and the target number of data units.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: In response to a user's operation instruction on the target Boolean data, based on the index value of the target Boolean data and the index number corresponding to each data unit, the data unit position where the target Boolean data is located is determined, the state of the data unit position where the target Boolean data is located is read, and a bit operation is performed based on the state of the target Boolean data.

4. The method according to claim 1, characterized in that The method further comprises: Determine whether the first decimal value corresponding to the current data unit in the container is greater than zero. If it is greater than zero, subtract one from the first decimal value and perform an AND operation with the current data unit to obtain a new data unit. Performing an XOR operation on the Boolean data in the new data unit and the Boolean data in the current data unit to obtain an XOR operation result, calculating a second decimal value corresponding to the XOR operation result, and determining the second decimal value as the position of the Boolean data in the true state in the current data unit; Calculate the position of the Boolean data in the true state in the first container based on the index number corresponding to the current data unit, the number of bits in the bit field, and the position of the Boolean data in the true state in the current data unit; The data unit after the first decimal value is subtracted by one is updated as the current data unit, and the step of determining whether the first decimal value corresponding to the current data unit in the container is greater than zero is repeatedly performed until the first decimal value of the current data unit is equal to zero; then looping to the next data unit of the container; All data units in the container are traversed to determine the number of all true-state Boolean data and their respective positions in the container.

5. The method according to claim 1, characterized in that The index numbers are assigned to the data units in each container in the same manner as the index numbers of the data units, and the method further comprises: Obtaining a first data unit in a first container and a second data unit in a second container, performing a bit operation on Boolean data in the first data unit and Boolean data in the second data unit, wherein the first data unit and the second data unit have the same index number, and the data units in the first container and the second container have the same number of storable bit fields; If there is no Boolean data at the current position of the first data unit in the first container, but there is Boolean data at the same position of the second data unit in the second container, the Boolean data at the current position of the first data unit is assumed to be false, and a bit operation is performed on the Boolean data at the same position of the second data unit.

6. The method according to claim 5, characterized in that The performing a bit operation on the Boolean data in the first data unit and the Boolean data in the second data unit comprises: Performing a logical OR operation on the Boolean data in the first data unit and the Boolean data in the second data unit, assigning the logical OR operation result to the first data unit, traversing all the data units in the first container and all the data units in the second container to obtain a new first container, or, Perform a logic AND operation on the Boolean data in the first data unit and the Boolean data in the second data unit, compare the result of the logic AND operation with the Boolean data in the second data unit, determine whether the Boolean data set existing in the first data unit includes the Boolean data set existing in the second data unit, traverse all data units in the first container and all data units in the second container, determine whether the Boolean data set existing in the first container includes the Boolean data set existing in the second container, the existing Boolean data represents Boolean data whose state is true, or, Performing a logical exclusive OR operation on the Boolean data in the first data unit and the Boolean data in the second data unit, assigning the logical exclusive OR operation result to the first data unit, traversing all the data units in the first container and all the data units in the second container, and updating the first container; Perform a logical exclusive OR operation on the Boolean data of the first data unit in the updated first container and the Boolean data of the second data unit, assign the logical exclusive OR operation result to the second data unit, traverse all the data units in the first container and all the data units in the second container, and update the second container; Perform a logical exclusive OR operation on the Boolean data of the first data unit in the updated first container and the Boolean data of the second data unit in the updated second container, assign the logical exclusive OR operation result to the first data unit, traverse all the data units in the first container and all the data units in the second container, and update the first container again to exchange the Boolean data in the first container with the Boolean data in the second container.

7. The method according to claim 1, characterized in that The method further comprises: In response to a container generation instruction operated by a user, determining the number of data units based on the number of Boolean data in the second configuration table in the container generation instruction and the number of bit fields that can be stored in each data unit; Create a container consisting of a corresponding number of data units in the second configuration table, match the index value corresponding to the first Boolean data in the second configuration table with the position of the data unit corresponding to the starting index number based on the offset in the container generation instruction, and store the Boolean data in the second configuration table in sequence, or, In response to a user's update instruction for the first configuration table, based on the number of Boolean data updates of the first configuration table in the update instruction, determining whether the number of Boolean data that can be stored in the current target number of data units is greater than the number of Boolean data updates; If the number of Boolean data that can be stored in the current target number of data units is not greater than the number of Boolean data updates, the number of bit field bits that can be stored in each data unit and the number of data units are redetermined, and based on the redetermined number of bit field bits that can be stored in each data unit, the Boolean data in the first configuration table is stored in the redetermined data unit.

8. A Boolean data storage device, characterized in that: The device comprises: a storage unit determination module, configured to determine, in response to a user's storage instruction for the first configuration table, the number of bit field bits that can be stored in each data unit and a target number of data units based on the number of Boolean data in the first configuration table, wherein each bit in the data unit represents a Boolean data in the first configuration table, and the number of Boolean data that can be stored in the target number of data units is greater than the number of Boolean data in the first configuration table; The data storage module is used to assign a corresponding index number to each data unit, and based on the index number corresponding to the data unit and the index value corresponding to the Boolean data in the first configuration table, store the Boolean data in the first configuration table in the corresponding data unit in sequence.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the Boolean data storage method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the Boolean data storage method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Boolean expression storage and matching method and system based on bitmap

    CN106469218A

  • Data processing method and device, storage medium and processor

    CN109582295A

  • Data storage method and device, equipment and storage medium

    CN117519606A

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

    CN117763205A

  • Boolean logic function block

    GB0411363D0