Target object relation storage method, device and system and storage medium
By using two-dimensional long integer arrays and preset formulas to quickly locate the target storage location, the problems of data redundancy and low resource utilization efficiency of target object relationship markers in the prior art are solved, and high-performance and efficient data access is achieved and storage.
Patent Information
- Application Number
- CN202411514249.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-14
AI Technical Summary
When marking the target relationship, the prior art has problems such as data redundancy, large space occupancy, degradation of time complexity and failure to support multi-threaded concurrent operations, and the resource utilization efficiency is not high.
A two-dimensional long integer array is used as the basic data structure, the target objects are numbered in sequence, and the relationship between the two target objects is identified through a bit, and the preset formula is used to quickly locate and access the target storage location.
It realizes thread-safe data access without locking in a high concurrency environment, improves data access performance, and significantly improves the utilization efficiency of storage resources by reducing storage space requirements.
Smart Images

Figure CN119441362A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of networked autonomous driving technology, and in particular to a target object relationship storage method, device, system and storage medium. Background Art
[0002] There are many ways to mark the relationship between targets, such as the most commonly used Hash table (HashMap), which combines the IDs of two targets into a key and saves the value of the relationship as the value in the Hash table, which can achieve fast access to the relationship. However, there are several problems with the Hash table. The first is that there are many redundant elements in the data structure of the Hash table, resulting in a large amount of space occupied when there is a large amount of vehicle data; second, although the time complexity of data access in the Hash table is theoretically O(1), it will degenerate to O(logn) or O(n) when there is a hash conflict; third, the Hash table does not support multi-threaded concurrent operations. In a high-concurrency environment, a locked thread-safe Hash table is required, which further reduces the performance of data access.
[0003] In response to the above problems, the prior art proposes a method of marking the relationship between target objects with a two-dimensional array, assigning an index to each target object, and marking the relationship between target objects in the two-dimensional array with two indexes. Using the index to locate the array, the target object relationship can be located within O(1) time complexity, and no locking is required, with extremely high performance; and only the relationship between the target objects needs to be saved in the array, and there is no redundant data to cause waste of resources. However, this solution also has several problems. First, although the access to data in this solution is usually thread-safe and does not require locking, when expanding the array, deleting data, and other operations, the entire array still needs to be locked to ensure the security of data operations; second, although this solution does not cause waste of storage resources due to redundant data, this method of using two-dimensional numbers to mark the relationship between target objects requires at least 2 2 = 4 bytes for identification, and if the relationship between 8 targets is identified, at least 8 2 = 64 bytes, there is still room for optimization of resource utilization.
[0004] Therefore, how to further improve the utilization efficiency of storage resources on the basis of improving data access performance is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present application provides a target object relationship storage method, device, system and storage medium, which are used to further improve the utilization efficiency of storage resources on the basis of improving data access performance.
[0006] The present application provides a target object relationship storage method, comprising:
[0007] When an instruction to store the relationship of the target objects is detected, the target objects are numbered in sequence;
[0008] Determine the number as the identification of the target object;
[0009] The target objects are stored in a two-dimensional array structure according to the identification order, wherein the two-dimensional array structure is composed of a basic data structure of n rows and n columns, the basic data structure is a two-dimensional long integer array, each two-dimensional long integer array is used to store the relationship between m target objects, each two-dimensional long integer array is a data structure of m rows and m columns, and the length of each row is m bits.
[0010] The beneficial effects of the present application are: Hash tables are not used as a way to mark the relationship between target objects, so there is no need to use locked thread-safe Hash tables in a high-concurrency environment, which improves the performance of data access. At the same time, in the present application, the relationship between two target objects can be identified by one bit, while when identifying the relationship between m target objects, m bits are required. 2 Therefore, compared with the method of marking the relationship between target objects with a two-dimensional array in the prior art, at least 8 times of storage space is saved, thereby further improving the utilization efficiency of storage resources on the basis of improving data access performance.
[0011] In one embodiment, the method further comprises:
[0012] When receiving information corresponding to the target object, comparing the information corresponding to the target object to determine the relationship of the target object;
[0013] Generates instructions for storing relationships between objects.
[0014] In one embodiment, the method further comprises:
[0015] When the two-dimensional array structure has been completely stored, the grids whose row numbers are smaller than their column numbers are deleted.
[0016] In one embodiment, the method further comprises:
[0017] When receiving a query request for the relationship between two target objects, obtaining the identifiers of the two target objects to be processed;
[0018] Substituting the two target object identifiers into a first preset formula to determine a target storage position of the relationship between the two target objects in a two-dimensional array structure, wherein the two-dimensional array structure is composed of a plurality of two-dimensional long integer arrays, and each storage position corresponds to a two-dimensional long integer array;
[0019] Substituting the two target object identifiers into a second preset formula to determine a first bit corresponding to the relationship identifiers of the two target objects;
[0020] The relationship identifier on the first bit is retrieved from the two-dimensional long integer array at the target storage location to determine the relationship between the two targets.
[0021] In one embodiment, substituting the two target object identifiers into a first preset formula to determine a target storage position of the relationship between the two target objects in a two-dimensional array structure includes:
[0022] Substitute the two target object identifiers into the following first preset formula to determine the target storage location of the relationship between the two target objects in the two-dimensional array structure:
[0023] row=a>>3;
[0024] col=b>>3;
[0025] Among them, row is the row number corresponding to the target storage location, col is the column number corresponding to the target storage location, and (a, b) are two target object identifiers.
[0026] In one embodiment, substituting the two target object identifiers into a second preset formula to determine a first bit corresponding to the relationship identifier of the two targets includes:
[0027] Substitute the two target object identifiers into the following second preset formula to determine the first bit corresponding to the relationship identifier of the two targets:
[0028] offset=((a&0x07)<<3)|(b&0x07);
[0029] Wherein, offset is the number of the first bit corresponding to the relationship identifier of the two targets, and (a, b) are the identifiers of the two targets.
[0030] In one embodiment, retrieving the relationship identifier on the first bit from the two-dimensional long integer array at the target storage location to determine the relationship between the two targets includes:
[0031] Determine whether the first bit is a deleted bit;
[0032] When the first bit is a deleted bit, a second bit symmetrical to the first bit is determined with the diagonal of the two-dimensional array structure as a symmetry axis;
[0033] The relationship identifier retrieved from the second bit is used as the relationship between the two targets.
[0034] The present application also provides a target object relationship storage device, comprising:
[0035] A numbering module, for numbering the objects in order when an instruction to store the relationship between the objects is detected;
[0036] A first determining module, used to determine that the number is the identification of the target object;
[0037] A storage module is used to store the target objects in a two-dimensional array structure according to the identification order, wherein the two-dimensional array structure is composed of a basic data structure of n rows and n columns, and the basic data structure is a two-dimensional long integer array. Each two-dimensional long integer array is used to store the relationship between m target objects, and the two-dimensional long integer array is a data structure of m rows and m columns.
[0038] In one embodiment, the apparatus further comprises:
[0039] A comparison module, for comparing the information corresponding to the target object when receiving the information corresponding to the target object, so as to determine the relationship between the target objects;
[0040] A generation module is used to generate instructions for storing the relationship of the target object.
[0041] In one embodiment, the apparatus further comprises:
[0042] The deleting module is used to delete the grids whose row numbers are smaller than the column numbers when the two-dimensional array structure has been completely stored.
[0043] In one embodiment, the apparatus further comprises:
[0044] An acquisition module, configured to acquire the identifiers of the two target objects to be processed when receiving a query request for the relationship between the two target objects;
[0045] A first substitution module, used for substituting the two target object identifiers into a first preset formula to determine a target storage position of the relationship between the two target objects in a two-dimensional array structure, wherein the two-dimensional array structure is composed of a plurality of two-dimensional long integer arrays, and each storage position corresponds to a two-dimensional long integer array;
[0046] A second substitution module, used for substituting the two target object identifiers into a second preset formula to determine a first bit corresponding to the relationship identifiers of the two target objects;
[0047] The second determining module is used to retrieve the relationship identifier on the first bit from the two-dimensional long integer array at the target storage position to determine the relationship between the two targets.
[0048] In one embodiment, the first substitution module is used to:
[0049] Substitute the two target object identifiers into the following first preset formula to determine the target storage location of the relationship between the two target objects in the two-dimensional array structure:
[0050] row=a>>3;
[0051] col=b>>3;
[0052] Among them, row is the row number corresponding to the target storage location, col is the column number corresponding to the target storage location, and (a, b) are two target object identifiers.
[0053] In one embodiment, the second substitution module is used to:
[0054] Substitute the two target object identifiers into the following second preset formula to determine the first bit corresponding to the relationship identifier of the two targets:
[0055] offset=((a&0x07)<<3)|(b&0x07);
[0056] Wherein, offset is the number of the first bit corresponding to the relationship identifier of the two targets, and (a, b) are the identifiers of the two targets.
[0057] In one embodiment, the determining module includes:
[0058] A judging submodule, used to judge whether the first bit is a deleted bit;
[0059] a determination submodule, configured to determine, when the first bit is a deleted bit, a second bit symmetrical to the first bit with the diagonal of the two-dimensional array structure as a symmetry axis;
[0060] The retrieving submodule is used to use the relationship identifier retrieved from the second bit as the relationship between the two targets.
[0061] The present application also provides a target object relationship storage system, including:
[0062] at least one processor; and,
[0063] a memory communicatively connected to the at least one processor; wherein,
[0064] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to implement the target object relationship storage method recorded in any of the above embodiments.
[0065] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the target object relationship storage system, the target object relationship storage system can implement the target object relationship storage method recorded in any of the above embodiments.
[0066] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings.
[0067] The technical solution of the present application is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:
[0069] Figure 1 This is a flow chart of a target object relationship storage method in one embodiment of the present application;
[0070] Figure 2 A schematic diagram of a memory structure in an embodiment of the present application;
[0071] Figure 3 A schematic diagram of a target storage location in an embodiment of the present application;
[0072] Figure 4 A schematic diagram of a memory structure in another embodiment of the present application;
[0073] Figure 5 A schematic diagram of a memory structure in another embodiment of the present application;
[0074] Figure 6 This is a schematic diagram of the hardware structure of a target object relationship storage system in one embodiment of the present application. DETAILED DESCRIPTION
[0075] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application.
[0076] Figure 1 Flow chart of a target object relationship storage method in one embodiment of the present application. Figure 1 As shown, the method can be implemented as the following steps S101-S103:
[0077] In step S101, when an instruction to store the relationship of the target objects is detected, the target objects are numbered in sequence;
[0078] In step S102, the number is determined to be the identifier of the target object;
[0079] In step S103, the target objects are stored in a two-dimensional array structure according to the identification order, wherein the two-dimensional array structure is composed of a basic data structure of n rows and n columns, and the basic data structure is a two-dimensional long integer array, each of which is used to store the relationship between m target objects, and each of which is a data structure of m rows and m columns, and the length of each row is m bits.
[0080] When an instruction to store the relationship between the target objects is detected, the target objects are numbered in sequence. Taking the fusion of roadside perception data as an example, in the field of connected autonomous driving and intelligent transportation, the vehicle-road collaborative cloud control basic platform (hereinafter referred to as the cloud control platform) receives the perception data reported by the roadside perception equipment (RCU / MEC). If a connected autonomous driving vehicle (hereinafter referred to as the connected vehicle) is connected, it will also receive the vehicle data reported by the connected autonomous driving vehicle and the perception data of surrounding vehicles. In order to ensure the continuity of perception data, when deploying roadside perception equipment, adjacent perception devices are usually overlapped. In addition, if a connected vehicle is connected, the connected vehicle itself will also upload its own data and the surrounding data it perceives, resulting in data duplication on the cloud control platform. Therefore, the cloud control platform needs to deduplicate the received data, integrate the data uploaded from various channels, ensure that the digital twins in the cloud correspond one-to-one with the real vehicles in the physical world, and provide accurate data for applications such as autonomous driving services and intelligent transportation. When the cloud is fused, all reported targets need to calculate the matching cost in pairs. The calculation of the matching cost usually involves the calculation of relative position, speed, heading, type and other factors, and the calculation is relatively complicated. In order to reduce the complexity of the calculation, according to the scheme provided in this application, it can be used to mark the relationship between the targets. The relationship between targets is divided into fusionable and non-fusionable. If the relationship between two targets is marked as non-fusionable, there is no need to calculate the matching cost of the two targets later. Therefore, in one embodiment of the present application, when the information corresponding to the target is received, the information corresponding to the target is compared to determine the relationship between the targets. The comparison can be performed using methods such as image recognition, which is not expanded in this application. After comparison, the relationship between the targets can be determined, such as fusion or non-fusion. Then, an instruction to store the relationship between the targets is generated, for example, fusion is marked with 1 and non-fusion is marked with 0. Through this marking method, most of the targets will be directly marked as non-fusionable, which greatly reduces the amount of fusion calculation and improves the efficiency of fusion. In order to facilitate subsequent calling and querying of the relationship of the target objects, when an instruction to store the relationship of the target objects is detected, the target objects are numbered in sequence, and the numbers are determined as the identifiers of the target objects for indexing the target objects.
[0081] Then, the target objects are stored in a two-dimensional array structure according to the identification order, wherein the two-dimensional array structure is composed of a basic data structure of n rows and n columns, and the basic data structure is a two-dimensional long integer array. Each two-dimensional long integer array is used to store the relationship between m target objects, and each two-dimensional long integer array is a data structure of m rows and m columns, and the length of each row is m bits.
[0082] In this solution, a two-dimensional long integer array is used as the basic data structure. Each long integer has 8 bytes, a total of 64 bits. The bit values 1 and 0 can be used to mark whether they can be merged, so each long can mark the relationship between 8 targets. In the prior art, it takes 8×8=64 bytes to mark the relationship between 8 targets, while this solution only needs 8 bytes, saving 8 times the space.
[0083] After the relationship between the targets is stored by the above method, the relationship between the two targets can be queried based on the identifiers of the two targets. When a query request for the relationship between the two targets is received, the identifiers of the two targets to be processed are obtained; for example, if the identifiers of the two targets are 23 and 60, the relationship between the targets (23, 60) is determined.
[0084] Substitute the two target object identifiers into the first preset formula to determine the target storage position of the relationship between the two target objects in the two-dimensional array structure, wherein the two-dimensional array structure is composed of multiple two-dimensional long integer arrays, and each storage position corresponds to a two-dimensional long integer array. Taking 64 target objects as an example, the length of the long array is 64. Figure 2 is a schematic diagram of a memory structure in an embodiment of the present application, such as Figure 2 As shown, in this memory structure, each small cell is a long. Figure 3 This is a schematic diagram of the target storage location in an embodiment of the present application. If the relationship between two targets numbered 23 and 60 is to be queried, that is, the relationship between the targets (23, 60) needs to be determined, each value is divided by 8 and rounded (that is, the binary data is shifted right by 3 bits) to obtain the location of the grid where the target storage location storing the target object relationship is located:
[0085] The row number corresponding to the target storage location is row=23>>3=2;
[0086] The column number corresponding to the target storage location is col=60>>3=7;
[0087] Furthermore, if Figure 3 As shown, the grid position of the target storage location is obtained as (2, 7), that is, it is located in the 2nd row and the 7th column.
[0088] Then substitute the two target object identifiers into the second preset formula to determine the first bit corresponding to the relationship identifier of the two target objects. The grid (2,7) is a 64-bit memory, using the upper 3 bits to represent 23 and the lower 3 bits to represent 60. The bit position of (23,60) can be calculated through bit operations to achieve fast access to the target object relationship. The formula is as follows:
[0089] offset = ((23 & 0x07) << 3) | (60 & 0x07);
[0090] Among them, offset is the bit number of the first bit corresponding to the relationship identifier of two target objects.
[0091] Retrieve the relationship identifier on the first bit from the two-dimensional long integer array at the target storage location to determine the relationship between the two target objects. Furthermore, through the value of the first bit at the grid position (2, 7), the relationship between the two target objects can be determined.
[0092] Through the above transformation, the memory usage for storing target object relationships is reduced to 1 / 8 of the original, and the time complexity of data access remains O(1).
[0093] Since the meanings represented by the target object relationships (a, b) and (b, a) are the same, that is, they are both the relationships between the target object with index a and the target object with index b, there is still room for optimization in the above data structure. Figure 4 This is a schematic diagram of the memory structure in another embodiment of the present application. In this embodiment, the relationships where a < b in all (a, b) can be converted to (b, a). For example, the accesses to (23, 60) and (60, 23) can be converted to the access to (60, 23), as Figure 4 shown. Based on this, delete all grids where the row number (row) < column number (col) to further save space. Still taking the access to (23, 60) as an example, the grid position where the target storage location is located is (7, 2). In this embodiment, when retrieving the relationship identifier on the first bit from the two-dimensional long integer array at the target storage location to determine the relationship between the two target objects, determine whether the first bit is a deleted bit. When the first bit is a deleted bit, determine the second bit symmetric to the first bit with the diagonal of the two-dimensional array structure as the axis of symmetry, and use the relationship identifier retrieved from the second bit as the relationship between the two target objects.
[0094] For the above memory structure, the initialization method of the two-dimensional array can no longer be used. Instead, the space of each layer is initialized separately. For example, the first row is initialized with a length of 1, and the second row is initialized with a length of 2. There is no longer a need for a large continuous space, reducing the requirement for continuous memory. Figure 5 This is a schematic diagram of the memory structure in yet another embodiment of the present application, as Figure 5As shown, the above memory structure is managed in the form of a one-dimensional bucket array. Each bucket can manage multiple rows of data. For example, if 4 rows are managed, the above 8-row structure requires 2 buckets. In this form, if the memory structure needs to be expanded due to an increase in the number of targets, it is only necessary to perform concurrency control when the bucket array is expanded to prevent multiple threads from expanding at the same time. Since only the data of the bucket array needs to be copied during expansion, the amount of data copied is very small, and the expansion speed will be very fast. In this process, data can still be accessed through the old bucket array, which will not reduce the concurrent performance of the program.
[0095] For example, when this solution is applied to the marking of large-scale vehicle fusion relationships, it not only meets the requirements of high concurrency and high performance, but also has the characteristics of low memory usage and low resource requirements. It can improve the performance of large-scale vehicle fusion on the cloud control platform and reduce resource utilization.
[0096] The beneficial effects of the present application are: Hash tables are not used as a way to mark the relationship between target objects, so there is no need to use locked thread-safe Hash tables in a high-concurrency environment, which improves the performance of data access. At the same time, in the present application, the relationship between two target objects can be identified by one bit, while when identifying the relationship between m target objects, m bits are required. 2 Therefore, compared with the method of marking the relationship between target objects with a two-dimensional array in the prior art, at least 8 times of storage space is saved, thereby further improving the utilization efficiency of storage resources on the basis of improving data access performance.
[0097] In one embodiment, the method can also be implemented as the following steps A1-A2:
[0098] In step A1, when the information corresponding to the target object is received, the information corresponding to the target object is compared to determine the relationship of the target object;
[0099] In step A2, an instruction to store the relationship of the target object is generated.
[0100] In one embodiment, the method can also be implemented as follows:
[0101] When the two-dimensional array structure has been completely stored, the grids whose row numbers are smaller than their column numbers are deleted.
[0102] In one embodiment, the method can also be implemented as the following steps B1-B4:
[0103] In step B1, when a query request for the relationship between two targets is received, the identifiers of the two targets to be processed are obtained;
[0104] In step B2, the two target object identifiers are substituted into a first preset formula to determine a target storage position of the relationship between the two target objects in a two-dimensional array structure, wherein the two-dimensional array structure is composed of a plurality of two-dimensional long integer arrays, and each storage position corresponds to a two-dimensional long integer array;
[0105] In step B3, the two target object identifiers are substituted into a second preset formula to determine a first bit corresponding to the relationship identifiers of the two target objects;
[0106] In step B4, the relationship identifier on the first bit is retrieved from the two-dimensional long integer array at the target storage location to determine the relationship between the two targets.
[0107] In one embodiment, the above step B2 can also be implemented as the following steps:
[0108] Substitute the two target object identifiers into the following first preset formula to determine the target storage location of the relationship between the two target objects in the two-dimensional array structure:
[0109] row=a>>3;
[0110] col=b>>3;
[0111] Among them, row is the row number corresponding to the target storage location, col is the column number corresponding to the target storage location, and (a, b) are two target object identifiers.
[0112] In one embodiment, the above step B3 can also be implemented as the following steps:
[0113] Substitute the two target object identifiers into the following second preset formula to determine the first bit corresponding to the relationship identifier of the two targets:
[0114] offset=((a&0x07)<<3)|(b&0x07);
[0115] Wherein, offset is the number of the first bit corresponding to the relationship identifier of the two targets, and (a, b) are the identifiers of the two targets.
[0116] In one embodiment, the above step B4 can also be implemented as the following steps B41-B43:
[0117] In step B41, determining whether the first bit is a deleted bit;
[0118] In step B42, when the first bit is a deleted bit, a second bit symmetrical to the first bit is determined with the diagonal of the two-dimensional array structure as a symmetry axis;
[0119] In step B43, the relationship identifier retrieved from the second bit is used as the relationship between the two targets.
[0120] The present application also provides a target object relationship storage device, comprising:
[0121] A numbering module, for numbering the objects in order when an instruction to store the relationship between the objects is detected;
[0122] A first determining module, used to determine that the number is the identification of the target object;
[0123] A storage module is used to store the target objects in a two-dimensional array structure according to the identification order, wherein the two-dimensional array structure is composed of a basic data structure of n rows and n columns, and the basic data structure is a two-dimensional long integer array. Each two-dimensional long integer array is used to store the relationship between m target objects, and the two-dimensional long integer array is a data structure of m rows and m columns.
[0124] In one embodiment, the apparatus further comprises:
[0125] A comparison module, for comparing the information corresponding to the target object when receiving the information corresponding to the target object, so as to determine the relationship between the target objects;
[0126] A generation module is used to generate instructions for storing the relationship of the target object.
[0127] In one embodiment, the apparatus further comprises:
[0128] The deleting module is used to delete the grids whose row numbers are smaller than the column numbers when the two-dimensional array structure has been completely stored.
[0129] In one embodiment, the apparatus further comprises:
[0130] An acquisition module, configured to acquire the identifiers of the two target objects to be processed when receiving a query request for the relationship between the two target objects;
[0131] A first substitution module, used for substituting the two target object identifiers into a first preset formula to determine a target storage position of the relationship between the two target objects in a two-dimensional array structure, wherein the two-dimensional array structure is composed of a plurality of two-dimensional long integer arrays, and each storage position corresponds to a two-dimensional long integer array;
[0132] A second substitution module, used for substituting the two target object identifiers into a second preset formula to determine a first bit corresponding to the relationship identifiers of the two target objects;
[0133] The second determining module is used to retrieve the relationship identifier on the first bit from the two-dimensional long integer array at the target storage position to determine the relationship between the two targets.
[0134] In one embodiment, the first substitution module is used to:
[0135] Substitute the two target object identifiers into the following first preset formula to determine the target storage location of the relationship between the two target objects in the two-dimensional array structure:
[0136] row=a>>3;
[0137] col=b>>3;
[0138] Among them, row is the row number corresponding to the target storage location, col is the column number corresponding to the target storage location, and (a, b) are two target object identifiers.
[0139] In one embodiment, the second substitution module is used to:
[0140] Substitute the two target object identifiers into the following second preset formula to determine the first bit corresponding to the relationship identifier of the two targets:
[0141] offset=((a&0x07)<<3)|(b&0x07);
[0142] Wherein, offset is the number of the first bit corresponding to the relationship identifier of the two targets, and (a, b) are the identifiers of the two targets.
[0143] In one embodiment, the determining module includes:
[0144] A judging submodule, used to judge whether the first bit is a deleted bit;
[0145] a determination submodule, configured to determine, when the first bit is a deleted bit, a second bit symmetrical to the first bit with the diagonal of the two-dimensional array structure as a symmetry axis;
[0146] The retrieving submodule is used to use the relationship identifier retrieved from the second bit as the relationship between the two targets.
[0147] Figure 6 FIG. 1 is a schematic diagram of the hardware structure of a target object relationship storage system in one embodiment of the present application. Figure 6 As shown, the target object relationship storage system includes:
[0148] at least one processor 620; and,
[0149] A memory 604 in communication with the at least one processor 620; wherein,
[0150] The memory 604 stores instructions that can be executed by the at least one processor 620, and the instructions are executed by the at least one processor 620 to implement the target object relationship storage method recorded in any of the above embodiments.
[0151] Reference Figure 6 The target object relationship storage system 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0152] The processing component 602 generally controls the overall operation of the target object relationship storage system 600. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0153] The memory 604 is configured to store various types of data to support the operation of the object relationship storage system 600. Examples of such data include instructions for any application or method operating on the object relationship storage system 600, such as text, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0154] The power supply component 606 provides power to various components of the object relationship storage system 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the object relationship storage system 600.
[0155] The multimedia component 608 includes a screen that provides an output interface between the target object relationship storage system 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 may also include a front camera and / or a rear camera. When the target object relationship storage system 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0156] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the target object relationship storage system 600 is in an operation mode, such as an alarm mode, a recording mode, a voice recognition mode, and a voice output mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0157] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0158] The sensor assembly 614 includes one or more sensors for providing various aspects of status evaluation for the target object relationship storage system 600. For example, the sensor assembly 614 may include a sound sensor. In addition, the sensor assembly 614 may detect the open / closed state of the target object relationship storage system 600, the relative positioning of the components, such as the display and keypad of the target object relationship storage system 600, and the sensor assembly 614 may also detect the operating state of the target object relationship storage system 600 or a component of the target object relationship storage system 600, the orientation or acceleration / deceleration of the target object relationship storage system 600 and the temperature change of the target object relationship storage system 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0159] The communication component 616 is configured to enable the target object relationship storage system 600 to provide the ability to communicate with other devices and cloud platforms in a wired or wireless manner. The target object relationship storage system 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0160] In an exemplary embodiment, the target object relationship storage system 600 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the target object relationship storage method described in any of the above embodiments.
[0161] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the target object relationship storage system, the target object relationship storage system can implement the target object relationship storage method recorded in any of the above embodiments.
[0162] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0163] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0164] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0165] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0166] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for storing target object relationships, characterized in that: include: When an instruction to store the relationship of the target objects is detected, the target objects are numbered in sequence; Determine the number as the identification of the target object; The target objects are stored in a two-dimensional array structure according to the identification order, wherein the two-dimensional array structure is composed of a basic data structure of n rows and n columns, the basic data structure is a two-dimensional long integer array, each two-dimensional long integer array is used to store the relationship between m target objects, and the two-dimensional long integer array is a data structure of m rows and m columns.
2. The method according to claim 1, characterized in that The method further comprises: When receiving information corresponding to the target object, comparing the information corresponding to the target object to determine the relationship of the target object; Generates instructions for storing relationships between objects.
3. The method according to claim 1, characterized in that The method further comprises: When the two-dimensional array structure has been completely stored, the grids whose row numbers are smaller than their column numbers are deleted.
4. The method according to claim 1, characterized in that The method further comprises: When receiving a query request for the relationship between two target objects, obtaining the identifiers of the two target objects to be processed; Substituting the two target object identifiers into a first preset formula to determine a target storage position of the relationship between the two target objects in a two-dimensional array structure, wherein the two-dimensional array structure is composed of a plurality of two-dimensional long integer arrays, and each storage position corresponds to a two-dimensional long integer array; Substituting the two target object identifiers into a second preset formula to determine a first bit corresponding to the relationship identifiers of the two target objects; The relationship identifier on the first bit is retrieved from the two-dimensional long integer array at the target storage location to determine the relationship between the two targets.
5. The method according to claim 4, characterized in that Substituting the two target object identifiers into a first preset formula to determine a target storage position of the relationship between the two target objects in a two-dimensional array structure includes: Substitute the two target object identifiers into the following first preset formula to determine the target storage location of the relationship between the two target objects in the two-dimensional array structure: row=a>>3; col=b>>3; Among them, row is the row number corresponding to the target storage location, col is the column number corresponding to the target storage location, and (a, b) are two target object identifiers.
6. The method according to claim 4, characterized in that Substituting the two target object identifiers into a second preset formula to determine a first bit corresponding to the relationship identifiers of the two target objects includes: Substitute the two target object identifiers into the following second preset formula to determine the first bit corresponding to the relationship identifier of the two targets: offset=((a&0x07)<<3)|(b&0x07); Wherein, offset is the number of the first bit corresponding to the relationship identifier of the two targets, and (a, b) are the identifiers of the two targets.
7. The method according to claim 4, characterized in that The step of retrieving the relationship identifier on the first bit from the two-dimensional long integer array at the target storage location to determine the relationship between the two targets includes: Determine whether the first bit is a deleted bit; When the first bit is a deleted bit, a second bit symmetrical to the first bit is determined with the diagonal of the two-dimensional array structure as a symmetry axis; The relationship identifier retrieved from the second bit is used as the relationship between the two targets.
8. A target object relationship storage device, characterized in that: include: A numbering module, for numbering the objects in order when an instruction to store the relationship between the objects is detected; A first determining module, used to determine that the number is the identification of the target object; A storage module is used to store the target objects in a two-dimensional array structure according to the identification order, wherein the two-dimensional array structure is composed of a basic data structure of n rows and n columns, and the basic data structure is a two-dimensional long integer array. Each two-dimensional long integer array is used to store the relationship between m target objects, and the two-dimensional long integer array is a data structure of m rows and m columns.
9. A target object relationship storage system, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to implement the target object relationship storage method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor corresponding to the target object relationship storage system, the target object relationship storage system can implement the target object relationship storage method as described in any one of claims 1 to 7.