Data association storage method and device, computer device and storage medium

By establishing associated index files and data packet files in the signaling analysis system and obtaining and updating offset information, the problems of large memory requirements and low data reverse lookup efficiency in traditional systems are solved, achieving efficient data storage and fast reverse lookup.

CN116185966BActive Publication Date: 2026-06-26BEIJING TUOMING COMM TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING TUOMING COMM TECH
Filing Date
2022-11-21
Publication Date
2026-06-26

Smart Images

  • Figure CN116185966B_ABST
    Figure CN116185966B_ABST
Patent Text Reader

Abstract

The application relates to a data correlation storage method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring a correlation data record identifier of a current latest correlation data packet to be searched; determining a correlation time and first offset information of the current latest correlation data packet according to the correlation data record identifier; acquiring second offset information of the current latest correlation data packet from a corresponding correlation index file based on the correlation time; and acquiring a correlation data packet corresponding to the second offset information from a corresponding correlation data packet file as a correlation data packet of a previous time sequence position based on the correlation time. The method can improve the data searching rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data association storage technology, and in particular to a data association storage method, apparatus, computer device and storage medium. Background Technology

[0002] In the field of mobile communications, both traditional signaling analysis systems and deep packet inspection (DPI) systems require signaling storage and reverse lookup of call flow data. The data recorded in the call flow are all related data, which means that the related data needs to be stored and looked up via signaling.

[0003] Currently, the main methods for achieving storage and fast reverse lookup are: caching recorded signaling data in memory or a swap partition (i.e., disk), and then centrally storing the cached data after the call process ends; during subsequent reverse lookup, data can be retrieved based on the correspondence between the call process identifier (ID) and the stored data. However, this method has a large memory requirement due to concurrent operations, long storage time, and large amounts of data to be stored.

[0004] Another common method for achieving storage and fast reverse lookup is to establish a mapping relationship between each data packet and the call flow ID, and store the data packets in real time. During subsequent reverse lookup, the data is retrieved based on the correspondence between the call flow ID and the stored data packet. This method can be implemented with less memory, but the efficiency of data reverse lookup depends entirely on the quality of the algorithm used to establish the mapping relationship. Summary of the Invention

[0005] Therefore, it is necessary to provide a data association storage method, apparatus, computer equipment, and storage medium that can improve the efficiency of related data retrieval in response to the above-mentioned technical problems.

[0006] A data association storage method, the method comprising:

[0007] Retrieve the identifier of the associated data record in the latest associated data packet;

[0008] Based on the associated data record identifier, obtain the first offset information of the latest associated data packet from the corresponding associated index file;

[0009] Based on the associated data record identifier, obtain the second offset information of the associated data packet located at the end of the corresponding associated data packet file;

[0010] The latest associated data packet is appended to the end of the associated data packet file and stored; and the first offset information is updated to the second offset information.

[0011] In one embodiment, the method further includes:

[0012] Obtain the associated data packet corresponding to the next time sequence position of the associated data record, and use it as the latest associated data packet;

[0013] Return to the step of obtaining the first offset information of the latest associated data packet from the corresponding associated index file based on the associated data record identifier, until the associated data packet corresponding to the associated data record is the last one, and obtain the associated data packet file corresponding to the associated data record.

[0014] In one embodiment, the method further includes:

[0015] Create an associated data record, wherein the associated data record includes an associated data record identifier;

[0016] Obtain the corresponding associated index file based on the associated data record identifier;

[0017] The index value of the first associated data packet corresponding to the associated data record in the associated index file is used to identify the start of the associated data packet.

[0018] In one embodiment, obtaining the first offset information of the latest associated data packet from the corresponding associated index file based on the associated data record identifier includes:

[0019] The memory address of the corresponding associated index file is obtained based on the associated data record identifier;

[0020] The associated index file is located based on the memory address, and the offset information of the latest associated data packet is read from the associated index file as the first offset information.

[0021] In one embodiment, after updating the first offset information to the second offset information, the method further includes: recording the updated second offset information in the header of the latest associated data packet.

[0022] A method for finding related data, the method comprising:

[0023] Retrieve the identifier of the associated data record for the latest associated data packet to be searched;

[0024] The association time and first offset information of the latest associated data packet are determined based on the associated data record identifier;

[0025] Based on the association time, obtain the second offset information of the latest associated data packet from the corresponding association index file;

[0026] Based on the associated time, the associated data packet corresponding to the second offset information is obtained from the corresponding associated data packet file as the associated data packet of the previous time sequence position.

[0027] In one embodiment, the method further includes:

[0028] Obtain the second offset information of the associated data packet of the previous time sequence bit;

[0029] The associated data packet of the previous time sequence position is taken as the latest associated data packet;

[0030] Return to the step of obtaining the associated data packet corresponding to the second offset information from the corresponding associated data packet file based on the associated time as the associated data packet of the previous time sequence position, until the index value of the second offset information is the start associated data packet, and obtain the associated data chain formed by all associated data packets corresponding to the associated data record identifier.

[0031] In one embodiment, obtaining the second offset information of the latest associated data packet from the corresponding association index file based on the association time includes:

[0032] Determine the associated index file corresponding to the associated time;

[0033] From the associated index file, the latest associated data packet corresponding to the first offset information is taken as the current latest associated data packet;

[0034] Obtain the second offset information of the latest associated data packet.

[0035] In one embodiment, obtaining the associated data packet corresponding to the second offset information from the corresponding associated data packet file based on the associated time as the associated data packet of the previous time sequence includes:

[0036] Determine the associated data packet file corresponding to the associated time;

[0037] From the associated data file, obtain the associated data packet corresponding to the second offset information as the associated data packet of the previous time sequence position of the current latest associated data packet.

[0038] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the data association storage and association data retrieval method described in the above embodiments.

[0039] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the data association storage and association data retrieval methods described in the above embodiments.

[0040] The aforementioned data association storage method, apparatus, computer equipment, and storage medium, during data association storage, pre-establish an association index file and an association data packet file; firstly, obtain the association data record identifier of the latest association data packet; based on the association data record identifier, obtain the first offset information of the latest association data packet from the association index file; and based on the association data record identifier, obtain the second offset information of the association data packet located at the end of the corresponding association data packet file; then, append the latest association data packet to the end of the association data packet file for storage, and update the first offset information to the second offset information, thereby realizing the association storage of the latest association data packet. The above steps are repeated until all association data packets corresponding to the association data record are associated and stored, completing the association data chain formed by all association data packets corresponding to the association data record identifier, providing a prerequisite for subsequent rapid reverse lookup. Attached Figure Description

[0041] Figure 1 This is a flowchart illustrating a data association storage method in one embodiment;

[0042] Figure 2 This is a flowchart illustrating a method for finding related data in one embodiment;

[0043] Figure 3 This is a schematic diagram of a related data lookup method in another embodiment;

[0044] Figure 4 This is a structural block diagram of a data association storage device in one embodiment;

[0045] Figure 5 This is a structural block diagram of an associated data lookup device in one embodiment;

[0046] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

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

[0048] The data association storage method provided in this application is applied to a data association storage system, which can be used in a terminal or a server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, while the server can be a standalone server or a server cluster consisting of multiple servers.

[0049] In one embodiment, such as Figure 1 As shown, a data association storage method is provided. Taking the application of this method to a computer device as an example, the method includes the following steps:

[0050] Step S102: Obtain the associated data record identifier of the latest associated data packet.

[0051] In the field of mobile communications, traditional signaling analysis systems or DPI systems typically involve many concurrent processes, necessitating the storage and retrieval of call flow signals. For instance, in a signaling system, multiple users may be making calls simultaneously, each with their own associated signaling processes, such as initiating a call, ringing, answering, and hanging up. This data is associated for the same user but not for different users.

[0052] Before storing associated data, associated data records must first be created. For example, when a user initiates a call, an associated data record needs to be created to indicate the start of the user's call process. Throughout this user's call flow, the associated data records sequentially record and store the data used in the entire process, forming a chain. For example, the stored associated data may include: call record creation – call initiation data – ringing data – answer connection data – hang-up data.

[0053] Each associated data record has a unique identifier that distinguishes it from other associated data; this identifier is called the associated data record identifier. The associated data record identifier can be formed using one or more combinations of numbers, letters, and characters.

[0054] In one embodiment, the associated data record identifier has a fixed naming rule. For example, the associated data record identifier (ID) has a fixed structure, meaning its length (in bytes) is always the same, so the position of each ID in the file is also deterministic. For example, 4 bytes of time (representing the second value since January 1, 1970) + 4 bytes of file offset + fixed bytes of other information (this can be determined according to the application, we use m to represent it), then the total length should be 4 + 4 + m = 8 + m; for example, the offset of the first ID of this time should be 0, then the offset of the second ID should be the length of the ID, and the offset of the nth ID is (8 + m) * (n - 1). Therefore, based on the structure of the associated data record identifier, the associated time can be obtained, and the index position of the associated index file can be calculated.

[0055] The latest associated data packet is located at the end of the file. Since files are stored by appending to the end, the associated data packet obtained from the end of the file is the latest data.

[0056] In one embodiment, before obtaining the associated data record identifier of the latest associated data packet, the method further includes: creating an associated data record, the associated data record including an associated data record identifier; obtaining a corresponding associated index file based on the associated data record identifier; and identifying the index value of the first associated data packet corresponding to the associated data record in the associated index file as the start associated data packet. The index value of the first associated data packet in the associated index file can be identified by "-1". When the computer device detects this identifier, it indicates that the queried associated data packet is the first associated data packet corresponding to the associated data record identifier.

[0057] Step S104: Obtain the first offset information of the latest associated data packet from the corresponding associated index file based on the associated data record identifier.

[0058] Specifically, the computer device obtains the associated data record identifier of the latest associated data packet, and searches for the first offset information of the latest associated data packet in the corresponding associated index file based on the obtained associated data record identifier. The association time of the latest data packet and the location of the corresponding index memory can be determined based on the structure of the associated data record identifier. Then, the corresponding associated index file is located based on the association time, and the first offset information of the latest associated data packet is read from the associated index file according to the location of the corresponding index memory.

[0059] In one embodiment, obtaining the first offset information of the latest associated data packet from the corresponding associated index file based on the associated data record identifier includes: obtaining the memory address of the corresponding associated index file based on the associated data record identifier; searching the associated index file according to the memory address; and reading the offset information of the latest associated data packet from the associated index file as the first offset information. This solution uses memory mapping (mmap) to search for the associated index file, that is, mapping the entire file content into memory and directly operating on memory.

[0060] Step S106: Based on the associated data record identifier, obtain the second offset information of the associated data packet located at the end from the corresponding associated data packet file.

[0061] Specifically, the computer device parses the associated data record identifier to obtain the location information of the indexed memory, that is, to obtain the first offset information of the index to the associated data packet file. Then, based on the association time determined by the associated data record identifier, the computer device opens the associated data packet file corresponding to the association time and obtains the offset information of the associated data packet at the end of the associated data packet file as the second offset information.

[0062] Step S108: Append the latest associated data packet to the end of the associated data packet file for storage; and update the first offset information to the second offset information.

[0063] In one embodiment, after updating the first offset information to the second offset information, the method further includes: recording the updated second offset information in the header of the latest associated data packet.

[0064] In one embodiment, the method further includes a computer device generating an association data record identifier for the latest association data packet, and calling a storage interface to append the generated association data record identifier and the latest association data packet to the end of the association data packet file for storage.

[0065] Specifically, after obtaining the first offset information of the latest associated data and the second offset information of the associated data packet located at the end of the associated data packet file, the computer device calls the storage interface to append the latest associated data packet and the first offset information to the end of the associated data packet file. The first offset information is then used as the offset information of the previous associated data packet. The offset information of the latest associated data packet itself is updated to the second offset information; while the first offset information is stored at the beginning of the latest associated data packet, serving as the offset information of the associated data packet in the previous time sequence.

[0066] In one embodiment, the method further includes: obtaining the associated data packet corresponding to the next time sequence position of the associated data record as the latest associated data packet; returning to the step of obtaining the first offset information of the latest associated data packet from the corresponding associated index file based on the associated data record identifier, until the associated data packet corresponding to the associated data record is the last bit, and obtaining the associated data packet file corresponding to the associated data record.

[0067] In this system, the associated data packets corresponding to the associated data records are stored in chronological order, following the order in which the associated data occurred. Specifically, after storing the latest associated data packet, the system retrieves the next associated data packet corresponding to the same data record in the next chronological order, and uses this as the latest associated data packet. Then, based on the associated data record identifier, the system retrieves the first offset information of the latest associated data packet from the corresponding associated index file, and the second offset information of the associated data packet located at the end of the associated data packet file from the corresponding associated data packet file. The latest associated data packet is appended to the end of the associated data packet file for storage, and the first offset information is updated to the second offset information. This process continues until the last associated data packet corresponding to the associated data record is obtained, thus forming the associated data chain of the entire associated data packet file corresponding to the associated data record. By establishing a fixed-structure association data record identifier for the associated data records, the association time and the index position of the associated data packet file corresponding to the latest associated data packet at that association time can be calculated based on the association data record identifier. Thus, the process of establishing associated data storage only involves three main steps: starting to establish the associated data record -> storing the associated data packet -> ending and closing the record. Correspondingly, this method is to obtain the ID -> store the ID-related data packet -> end and close the notification. In this method, no actual storage-related actions are required for the end and close notification.

[0068] The aforementioned data association storage method, during data association storage, pre-establishes an association index file and an association data packet file; firstly, it obtains the association data record identifier of the latest association data packet, and based on this association data record identifier, retrieves the first offset information of the latest association data packet from the association index file; then, based on the association data record identifier, it retrieves the second offset information of the association data packet located at the end of the corresponding association data packet file; finally, it appends the latest association data packet to the end of the association data packet file for storage, and updates the first offset information to the second offset information, thereby realizing the association storage of the latest association data packet. This process is repeated until all association data packets corresponding to the association data record are associated and stored, completing the association data chain formed by all association data packets corresponding to the association data record identifier, providing a prerequisite for subsequent rapid reverse lookup.

[0069] In one embodiment, such as Figure 2 As shown, a method for finding related data is provided. Taking the application of this method to computer devices as an example, the method includes the following steps:

[0070] Step S202: Obtain the associated data record identifier of the latest associated data packet to be searched.

[0071] Step S204: Determine the association time and first offset information of the latest associated data packet based on the associated data record identifier.

[0072] The first offset information is information that can locate the index position of the latest associated data packet in the associated index file.

[0073] In one embodiment, obtaining the second offset information of the latest associated data packet from the corresponding association index file based on the association time includes: determining the association index file corresponding to the association time; taking the latest associated data packet corresponding to the first offset information from the association index file as the latest associated data packet; and obtaining the second offset information of the latest associated data packet.

[0074] Step S206: Obtain the second offset information of the latest associated data packet from the corresponding associated index file based on the associated time.

[0075] Step S208: Based on the associated time, obtain the associated data packet corresponding to the second offset information from the corresponding associated data packet file as the associated data packet of the previous time sequence position.

[0076] In one embodiment, obtaining the associated data packet corresponding to the second offset information from the corresponding associated data packet file based on the associated time as the associated data packet of the previous time sequence includes: determining the associated data packet file corresponding to the associated time; and obtaining the associated data packet corresponding to the second offset information from the associated data packet file as the associated data packet of the previous time sequence of the latest associated data packet.

[0077] In one embodiment, the method further includes: obtaining second offset information of the associated data packet of the previous time sequence position; taking the associated data packet of the previous time sequence position as the latest associated data packet; returning to the step of obtaining the associated data packet corresponding to the second offset information from the corresponding associated data packet file based on the association time as the associated data packet of the previous time sequence position, until the index value of the second offset information is the start associated data packet, and obtaining the associated data chain formed by all associated data packets corresponding to the associated data record identifier.

[0078] Specifically, after completing the search for the latest associated data packet, the computer device obtains the second offset information of the associated data packet of the previous time sequence position; takes the associated data packet of the previous time sequence position as the latest associated data packet; and obtains the associated data packet corresponding to the second offset information from the corresponding associated data packet file based on the association time as the associated data packet of the previous time sequence position, until the index value of the second offset information is the start associated data packet, thus obtaining the associated data chain formed by all associated data packets corresponding to the associated data record identifier.

[0079] In one embodiment, such as Figure 3 The diagram illustrates the process of retrieving associated data. As shown, the associated data record identifier (ID) has a fixed structure, including time, offset information, and other custom information. Therefore, the position of each ID in the file is determinable; for example, it might be 4 bytes of time + 4 bytes of file offset + a fixed number of bytes of other information (m). The offset of the first ID at that time should be 0, the second ID should be its length, and the nth ID would be (8 + m) * (n - 1). The associated time can be directly obtained from the associated data record identifier. The first offset information can be calculated based on the structure of the associated data record identifier, the number of bytes in each dimension, and the number of associated data record identifiers corresponding to the associated time.

[0080] The computer device determines the association time and first offset information (offset1 in the figure) of the latest associated data packet based on the association record identifier. It then opens the association index file corresponding to the association time (the association record index file in the figure), locates the position of the latest associated data packet in the association index file based on the first offset information (i.e., moves the file pointer to the position of the first offset information in the association index file), and reads the second offset information (offset2 in the figure) of the last associated data packet in the association index file. Next, the computer device opens the associated data packet file corresponding to the association time, moves the file pointer to the position of the second offset information (the position of associated data packet 1 in the figure), reads the offset information of the associated data packet of the previous time sequence (as shown in associated data packet 2 in the figure), and updates the second offset information to the offset information of associated data packet 2. In other words, it retrieves the associated data packet with the corresponding second offset information from the associated data packet file corresponding to the association time, using it as the associated data packet of the previous time sequence. Then, it retrieves the second offset information of associated data packet 2, and retrieves the associated data packet 3 with the corresponding second offset information from the associated data packet file corresponding to the association time, using it as the associated data packet of the previous time sequence. Then, the second offset information of associated data packet 3 is obtained, and associated data packet 4 with the corresponding second offset information is obtained from the associated data packet file corresponding to the associated time. This is used as the associated data packet of the previous time sequence. At this time, the computer device detects that the index value of the second offset information of associated data packet 4 is the start of the associated data packet. The search for associated data packets is stopped when the offset information of the read associated data packet is the start of the associated data packet. This indicates that the entire data chain has been read and the process of reverse lookup of associated data has been completed. The associated data chain formed by all associated data packets corresponding to the associated data record identifier is obtained.

[0081] In the aforementioned method for finding related data, based on the associated data record identifier of the latest associated data packet to be searched, the index position of the latest associated data packet in the associated index file can be located, and the index position of the last associated data packet in the associated index file at the corresponding associated time can be obtained, thereby finding the associated data packet at the previous time sequence position of the latest associated data packet; through the linked list structure stored in the associated data file, all associated data packet files can be traversed to achieve the purpose of fast reverse lookup, thereby improving the speed of finding related data.

[0082] It should be understood that, although Figure 1 , Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 ,Figure 2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0083] In one embodiment, such as Figure 4 As shown, a data association storage device 400 is provided, including: a first association data record identifier acquisition module 402, a first offset information acquisition module 404, a second offset information acquisition module 406, and an association data storage update module 408, wherein:

[0084] The first associated data record identifier acquisition module 402 is used to acquire the associated data record identifier of the latest associated data packet.

[0085] The first offset information acquisition module 404 is used to obtain the first offset information of the latest associated data packet from the corresponding associated index file based on the associated data record identifier.

[0086] The second offset information acquisition module 406 is used to acquire the second offset information of the associated data packet located at the end of the associated data packet from the corresponding associated data packet file based on the associated data record identifier.

[0087] The associated data storage update module 408 is used to append the latest associated data packet to the end of the associated data packet file for storage; and update the first offset information to the second offset information.

[0088] In one embodiment, the apparatus further includes a circular storage module, configured to obtain the associated data packet corresponding to the next time sequence position of the associated data record as the latest associated data packet; return to the step of obtaining the first offset information of the latest associated data packet from the corresponding associated index file based on the associated data record identifier, until the associated data packet corresponding to the associated data record is the last bit, thereby obtaining the associated data packet file corresponding to the associated data record.

[0089] In one embodiment, the apparatus further includes an associated data record creation module, configured to create an associated data record, the associated data record including an associated data record identifier; obtain a corresponding associated index file based on the associated data record identifier; and mark the index value of the first associated data packet corresponding to the associated data record in the associated index file as the start associated data packet.

[0090] In one embodiment, the first offset information acquisition module obtains the memory address of the corresponding associated index file based on the associated data record identifier; searches for the associated index file according to the memory address, and reads the offset information of the latest associated data packet from the associated index file as the first offset information.

[0091] In one embodiment, the associated data storage update module is further configured to record the updated second offset information in the header of the latest associated data packet.

[0092] The aforementioned data association storage device, during data association storage, pre-establishes an association index file and an association data packet file; it first obtains the association data record identifier of the latest association data packet, and then obtains the first offset information of the latest association data packet from the association index file based on the association data record identifier; and then obtains the second offset information of the association data packet located at the end of the corresponding association data packet file based on the association data record identifier; then it appends the latest association data packet to the end of the association data packet file for storage, and updates the first offset information to the second offset information, thereby realizing the association storage of the latest association data packet. The above steps are repeated until all association data packets corresponding to the association data record are stored in association, thus completing the association data chain formed by all association data packets corresponding to the association data record identifier, providing a prerequisite for subsequent rapid reverse lookup.

[0093] In one embodiment, such as Figure 5 As shown, a data association lookup device 500 is provided, including: a second data association record identifier acquisition module 502, a data association time offset information determination module 504, a second offset information lookup and acquisition module 506, and a data association data packet lookup module 508, wherein:

[0094] The second associated data record identifier acquisition module 502 is used to acquire the associated data record identifier of the latest associated data packet to be searched.

[0095] The associated time offset information determination module 504 is used to determine the association time and first offset information of the latest associated data packet based on the associated data record identifier.

[0096] The second offset information lookup and acquisition module 506 is used to obtain the second offset information of the latest associated data packet from the corresponding associated index file based on the associated time.

[0097] The associated data packet lookup module 508 is used to retrieve the associated data packet corresponding to the second offset information from the corresponding associated data packet file based on the associated time as the associated data packet of the previous time sequence position.

[0098] In one embodiment, the apparatus further includes a loop lookup module, configured to obtain second offset information of the associated data packet of the previous time sequence position; use the associated data packet of the previous time sequence position as the latest associated data packet; return to the step of obtaining the associated data packet corresponding to the second offset information from the corresponding associated data packet file based on the association time as the associated data packet of the previous time sequence position, until the index value of the second offset information is the start associated data packet, and obtain the associated data chain formed by all associated data packets corresponding to the associated data record identifier.

[0099] In one embodiment, the second offset information lookup and acquisition module is further configured to determine the association index file corresponding to the association time; from the association index file, take the latest association data packet corresponding to the first offset information as the current latest association data packet; and acquire the second offset information of the current latest association data packet.

[0100] In one embodiment, the associated data packet lookup module is further configured to determine the associated data packet file corresponding to the associated time; and from the associated data including file, obtain the associated data packet corresponding to the second offset information as the associated data packet of the previous time sequence position of the current latest associated data packet.

[0101] In the aforementioned associated data lookup device, based on the associated data record identifier of the latest associated data packet to be searched, the index position of the latest associated data packet in the associated index file can be located, and the index position of the last associated data packet in the associated index file in the associated data packet file corresponding to the associated time can be obtained, thereby finding the associated data packet of the previous time sequence position of the latest associated data packet; through the linked list structure stored in the associated data file, all associated data packet files can be traversed to achieve the purpose of fast reverse lookup, thereby improving the speed of associated data lookup.

[0102] Specific limitations regarding the data-associated storage device can be found in the limitations of the data-associated storage method described above, and will not be repeated here. Each module in the aforementioned data-associated storage device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

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

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

[0105] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the above-described data association storage and association data retrieval method.

[0106] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described data association storage and association data retrieval methods.

[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

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

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

Claims

1. A data association storage method, characterized in that, The method includes: Retrieve the identifier of the associated data record in the latest associated data packet; Based on the associated data record identifier, obtain the first offset information of the latest associated data packet from the corresponding associated index file; Based on the associated data record identifier, obtain the second offset information of the associated data packet located at the end of the corresponding associated data packet file; The latest associated data packet is appended to the end of the associated data packet file and stored; the first offset information is updated to the second offset information, and the updated second offset information is recorded at the beginning of the latest associated data packet. The step of obtaining the first offset information of the latest associated data packet from the corresponding associated index file based on the associated data record identifier includes: The memory address of the corresponding associated index file is obtained based on the associated data record identifier; The associated index file is located based on the memory address, and the offset information of the latest associated data packet is read from the associated index file as the first offset information.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the associated data packet corresponding to the next time sequence position of the associated data record, and use it as the latest associated data packet; Return to the step of obtaining the first offset information of the latest associated data packet from the corresponding associated index file based on the associated data record identifier, until the associated data packet corresponding to the associated data record is the last one, and obtain the associated data packet file corresponding to the associated data record.

3. The method according to claim 1, characterized in that, The method further includes: Create an associated data record, wherein the associated data record includes an associated data record identifier; Obtain the corresponding associated index file based on the associated data record identifier; The index value of the first associated data packet corresponding to the associated data record in the associated index file is used to identify the start of the associated data packet.

4. A method for retrieving related data, characterized in that, The method includes: Retrieve the identifier of the associated data record for the latest associated data packet to be searched; The association time and first offset information of the latest associated data packet are determined based on the associated data record identifier; the first offset information represents the index position of the latest associated data packet in the association index file. Based on the association time, obtain the second offset information of the latest associated data packet; Based on the associated time, the associated data packet corresponding to the second offset information is obtained from the corresponding associated data packet file as the associated data packet of the previous time sequence position; The second offset information for obtaining the latest associated data packet based on the association time includes: Determine the associated index file corresponding to the associated time; In the associated index file, the latest associated data packet corresponding to the first offset information is taken as the current latest associated data packet; Obtain the second offset information of the latest associated data packet from the header of the latest associated data packet.

5. The method according to claim 4, characterized in that, The method further includes: Obtain the second offset information of the associated data packet in the associated data packet file of the previous time sequence bit; The associated data packet of the previous time sequence position is taken as the latest associated data packet; Return to the step of obtaining the associated data packet corresponding to the second offset information from the corresponding associated data packet file based on the associated time as the associated data packet of the previous time sequence position, until the index value of the second offset information is the start associated data packet, and obtain the associated data chain formed by all associated data packets corresponding to the associated data record identifier.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.