Message length information storage method and device, electronic equipment and storage medium

By flexibly allocating storage space in the storage unit and adapting to network message length information of different lengths, the problem of waste of storage space caused by fixed storage space in the prior art is solved, and more efficient storage and reading performance is achieved.

CN120104039APending Publication Date: 2025-06-06QI AN XIN TECHNOLOGY GROUP INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311667275.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-06
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

In the prior art, when storing network packet length information with a fixed storage space size, a large amount of storage space is problematic.

Method used

By defining a storage unit containing 11 bits of storage space and target status bits, the storage space is flexibly allocated to adapt to message length information of different lengths. For message length information less than or equal to 2047, a single storage unit is used; for message length information greater than 2047, two storage units are used for storage.

Benefits of technology

It improves the utilization rate of storage space, effectively solves the problem of waste of storage space, and achieves more efficient storage and read performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104039A_ABST
    Figure CN120104039A_ABST
Patent Text Reader

Abstract

The invention provides a message length information storage method and device, electronic equipment and a storage medium, and the method comprises the steps: responding to a storage request for the message length information of a target network message, and judging whether the message length indicated by the message length information is not less than 2048 bits or not; if not, checking a specified status bit of a database entry corresponding to a data stream where the target network message is located; the specified state bit is an unaligned state or an aligned state; constructing a storage unit in the database entry based on the specified status bit; the storage unit comprises 12 bits, the twelfth bit of the storage unit is a target status bit, and the target status bit is in a non-continuous state or a continuous state; and writing the message length information into the storage unit, and setting the target state position of the storage unit as a non-continuous state. According to the scheme, the problem of storage space waste when the message length information is stored in a fixed storage space size in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a method and device for storing message length information, an electronic device, and a computer-readable storage medium. Background Art

[0002] In the network full-flow storage and indexing system, it is required to extract relevant network messages according to the search conditions. To support this requirement, the index position of the network message needs to be recorded at the same time when the network message is stored. Due to the large number of network messages, how to organize and save the index position information of the message will directly affect the size of the disk occupied by the index position information and the extraction speed of the network message. A class of messages with the same source address, destination address and protocol in the network constitute a data flow.

[0003] For network messages of the same data stream, the message length information of all network messages can be stored in a single entry in the database, and the storage form is the mapping relationship between the data stream ID (Identity document) and the database entry. The database entry can include multiple message length information of consecutive network messages. Exemplarily, the length of 4 consecutive network messages is 1000 bytes, then the database entry is 1000100010001000. In order to facilitate reading the message length information of each network message from the database entry, a fixed length method is usually used to store the message length information of each network message. The message length of the network message ranges from 0 to 65535 bits. When storing the message length with a fixed storage space size, in order to meet the maximum message length, two bytes (16 bits) need to be allocated for each message length information.

[0004] However, due to the limitation of MTU (Maximum Transmission Unit), the message length of most network messages is less than 1500, and the message length information itself only occupies 11 bits when stored. If 16 bits are allocated by default, 31.25% of the storage space is wasted. It can be seen that the storage method of the message length information of the network message in the relevant scheme wastes a lot of storage space. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a method and device for storing message length information, an electronic device, and a storage medium, which are used to provide a flexible storage space allocation method, reasonably allocate storage space for message length information, and solve the problem of storage space waste when storing message length information with a fixed storage space size in the related art.

[0006] On the one hand, the present application provides a method for storing message length information, including:

[0007] In response to a storage request for message length information of a target network message, determining whether a message length indicated by the message length information is not less than 2048 bits;

[0008] If not, checking a specified state bit of a database entry corresponding to the data flow where the target network message is located; wherein the specified state bit is an unaligned state or an aligned state;

[0009] Constructing a storage unit in the database entry based on the specified state bit; wherein the storage unit includes 12 bits, the 12th bit of the storage unit is a target state bit, and the target state bit is a non-continuation state or a continuation state;

[0010] The message length information is written into the storage unit, and the target state position of the storage unit is set to a non-continuation state.

[0011] In one embodiment, constructing a storage unit in the database entry based on the specified status bit includes:

[0012] If the designated state bit is in an unaligned state, constructing the last 4 bits of the last used byte of the database entry and another unused byte after the last used byte into a storage unit;

[0013] If the specified state bit is the alignment state, a storage unit is constructed with two unused bytes after the last used byte of the database entry; wherein the first 4 bits of the second unused byte belong to the storage unit.

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

[0015] If the designated state bit is in an unaligned state, after writing the message length information into the storage unit, updating the designated state bit to an aligned state;

[0016] If the designated state bit is in the aligned state, after the message length information is written into the storage unit, the designated state bit is updated to the unaligned state.

[0017] In one embodiment, the method further comprises:

[0018] If the message length indicated by the message length information is not less than 2048 bits, checking a specified status bit of a database entry corresponding to the target network message;

[0019] constructing two storage locations within the database entry based on the specified status bits;

[0020] Splitting the message length information into first sub-information and second sub-information, and writing the first sub-information into a first storage unit and writing the second sub-information into a second storage unit; wherein the first sub-information includes the first 11 bits of data in the message length information, and the second sub-information is the data obtained by subtracting the first sub-information from the message length information;

[0021] The target state position of the first storage unit is set to a continuation state, and the target state position of the second storage unit is set to a non-continuation state.

[0022] In one embodiment, constructing two storage units in the database entry based on the specified state bit includes:

[0023] If the specified state bit is an aligned state, two storage units are constructed with three unused bytes after the last used byte of the database entry;

[0024] If the designated status bit is in an unaligned state, the last 4 bits of the last used byte of the database entry and the three unused bytes after the last used byte construct two storage units; wherein the first 4 bits of the third unused byte belong to the second storage unit.

[0025] In one embodiment, the method further comprises:

[0026] If the designated state bit is in an unaligned state, after writing the message length information into the storage unit, updating the designated state bit to an unaligned state;

[0027] If the designated status bit is the aligned status, after the message length information is written into the storage unit, the designated status bit is updated to the aligned status.

[0028] In one embodiment, the method further comprises:

[0029] In response to a read request for message length information of a specified network message, determining that the specified network message is the nth network message in the data stream in which it is located by using the read request; wherein n is a positive integer;

[0030] In the database entry corresponding to the data stream where the designated network message is located, three bytes of data are read cyclically, and the fourth bit of the second byte and the eighth bit of the third byte are checked respectively to see whether a non-continuation state is recorded;

[0031] After each non-continuation state is detected, the search count is increased by one; wherein the initial value of the search count is 0;

[0032] When the search count is n-1, the subsequently read data is saved to the specified reading position;

[0033] When the search count is n, stop reading data, remove the target status bit of the read data in the designated reading position, and generate the message length information of the designated network message.

[0034] On the other hand, the present application provides a storage device for message length information, including:

[0035] A judgment module, configured to judge, in response to a storage request for message length information of a target network message, whether the message length indicated by the message length information is not less than 2048 bits;

[0036] A checking module, for checking, if not, a specified status bit of a database entry corresponding to the data flow where the target network message is located; wherein the specified status bit is an unaligned state or an aligned state;

[0037] A construction module, configured to construct a storage unit in the database entry based on the specified state bit; wherein the storage unit includes 12 bits, the 12th bit of the storage unit is a target state bit, and the target state bit is a non-continuation state or a continuation state;

[0038] The storage module is used to write the message length information into the storage unit and set the target state position of the storage unit to a non-continuation state.

[0039] Furthermore, the present application provides an electronic device, the electronic device comprising:

[0040] processor;

[0041] a memory for storing processor-executable instructions;

[0042] Wherein, the processor is configured to execute the above-mentioned method for storing message length information.

[0043] In addition, the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by a processor to complete the above-mentioned method for storing message length information.

[0044] In the present application, since the message length information of most network messages only occupies 11 bits when stored, by defining a storage space containing 11 bits and a storage unit of a target status bit, a corresponding number of storage units are allocated to each network message according to its message length information. Compared with the related art of storing message length information with a fixed storage space size, the utilization rate of the storage space can be improved, and the problem of storage space waste is effectively solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application are briefly introduced below.

[0046] Figure 1 A schematic diagram of an application scenario of a method for storing message length information provided in an embodiment of the present application;

[0047] Figure 2 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;

[0048] Figure 3 A flowchart of a method for storing message length information provided in an embodiment of the present application;

[0049] Figure 4 A flowchart of a method for storing message length information provided in another embodiment of the present application;

[0050] Figure 5 A schematic diagram of the overall process of a method for storing message length information provided in an embodiment of the present application;

[0051] Figure 6 A flowchart of a method for reading message length information provided in an embodiment of the present application;

[0052] Figure 7 A block diagram of a storage device for message length information provided in one embodiment of the present application. DETAILED DESCRIPTION

[0053] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0054] Similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0055] Figure 1 Schematic diagram of application scenarios of the method for storing message length information provided in the embodiment of the present application. Figure 1 As shown, the application scenario includes a client 20 and a server 30; the client 20 can be a user terminal such as a host, a mobile phone, a tablet computer, or a server, a server cluster or a cloud computing center, which is used to send a storage request for message length information to the server 30; the server 30 can be a host, a server, a server cluster or a cloud computing center, which can process the storage request.

[0056] like Figure 2 As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 2 A processor 11 is taken as an example. The processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 so that the electronic device 1 can execute all or part of the process of the method in the following embodiment. In one embodiment, the electronic device 1 can be the above-mentioned server 30, which is used to execute the method for storing message length information.

[0057] The memory 12 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 red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0058] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by the processor 11 to complete the method for storing message length information provided in the present application.

[0059] In order to solve the problem of storage space waste when storing message length information with a fixed storage space size in the prior art, the present application provides a method for encoding message length information. In this scheme, 12 bits can be constructed as a storage unit, and the first 11 bits of the storage unit are used to store the content of the message length information. The 11th bit of the storage unit is the target state bit, and the target state is a non-continuation state or a continuation state. If the target state is a non-continuation state, it means that the message length information has been stored in the current storage unit; if the target state is a continuation state, it means that the message length information has not been stored in the current storage unit, and the next storage unit is required to store the remaining data (after the next storage unit stores the remaining data, the target state set is a non-continuation state).

[0060] For message length information with a value less than or equal to 2047, the message length information can be stored through a storage unit, and the storage form is the same as the original binary storage. For example, the original binary storage form of decimal 1000 is 0011 1110 1000, and the present application solution is also stored as 0011 1110 1000. Among them, the 0 on the 12th bit can represent a non-continuation state.

[0061] For message length information with a value greater than 2047, the message length information is stored through two storage units. The first 11 bits of data in the message length information are written to the first storage unit, and the remaining number of the message length information is written to the second storage unit. Among them, the 12th bit of the first storage unit is set to a continuation state, and the 12th bit of the second storage unit is set to a non-continuation state. For example: the original binary storage form of the decimal 10000 is 00100111 00010000, and it is stored in the storage form in this application as 0000 0000 0100 1111 0001 0000. Among them, 1 on the 12th bit indicates a continuation state, and 0 on the 24th bit indicates a non-continuation state.

[0062] The application process of the encoding method proposed in this application is explained below with specific storage methods and reading methods.

[0063] See also Figure 3 , is a flow chart of a method for storing message length information provided in an embodiment of the present application, such as Figure 3 As shown, the method may include the following steps 310 to 340.

[0064] Step 310: In response to a request to store message length information of a target network message, determine whether the message length indicated by the message length information is not less than 2048 bits.

[0065] The target network message is a network message that needs to be stored. After storing the target network message, the message length information of the target network message needs to be stored.

[0066] When responding to the storage request, it can be determined whether the message length indicated by the message length information is not less than 2048 bits. On the one hand, if the message length indicated by the message length information is not less than 2048 bits, the message length information needs to be stored in two storage units, as described below. On the other hand, if the message length indicated by the message length information is less than 2048 bits, step 320 can be continued.

[0067] Step 320: If not, check the specified status bit of the database entry corresponding to the data flow where the target network message is located; wherein the specified status bit is an unaligned state or an aligned state.

[0068] When the message length indicated by the message length information is less than 2048 bits, the specified status bit of the database entry corresponding to the data flow where the target network message is located can be checked. Here, the data flow where the target network message is located can be determined by the source address, destination address and protocol number of the target network message, and then the specified status bit of the database entry corresponding to the data flow can be checked in the database.

[0069] For a data stream that has already constructed a database entry in the database, a specified status bit can be set for the database entry, and the specified status bit indicates whether the database entry is aligned. Since the storage unit defined in this scheme contains 12 bits, that is, 1.5 bytes, and the actual storage process processes the whole byte. If the database entry currently uses an even number of storage units to write several message length information, each used byte is used as part of the storage unit. At this time, the last used byte in the database entry is fully used, and the used bytes are aligned with the written data, so the database entry can be considered to be in an aligned state. If the database entry currently uses an odd number of storage units to write several message length information, the last used byte in the database only uses the first 4 bits, and the last 4 bits have not yet been written with data. The used bytes are not aligned with the written data, and the database entry can be considered to be in an unaligned state. Exemplarily, 0 represents an unaligned state, and 1 represents an aligned state.

[0070] In addition, if there is no database entry corresponding to the data flow where the target network message is located in the database, a database entry may be created for the data flow, and the specified state position may be set to the alignment state.

[0071] Step 330: construct a storage unit in the database entry based on the specified state bit; wherein the storage unit includes 12 bits, the 12th bit of the storage unit is the target state bit, and the target state bit is a non-continuation state or a continuation state.

[0072] After checking the specified status bit, a storage location can be constructed in the database entry to accommodate the specified status bit.

[0073] In one embodiment, if the designated status bit is in an unaligned state, it means that the last 4 bits of the last used byte of the database entry have not been written with data. At this time, the last 4 bits of the last used byte and another unused byte after the last byte can be constructed as a storage unit.

[0074] If the specified status bit is aligned, it means that the last used byte of the database entry has all belonged to the last used storage unit. In this case, a storage unit can be constructed with two unused bytes after the last used byte of the database entry. The storage unit includes 8 bits of the first unused byte and the first 4 bits of the second unused byte. The last 4 bits of the second unused byte do not belong to the storage unit.

[0075] Step 340: Write the message length information into the storage unit, and set the target state position of the storage unit to a non-continuation state.

[0076] After the storage unit is constructed, the message length information can be written into the storage unit. Since the message length indicated by the message length information is less than 2048 bits, the storage can be completed with 11 bits of a single storage unit without using another storage unit, so the target state bit of the storage unit can be set to a non-continuation state.

[0077] Through the above measures, since the message length information of most network messages only occupies 11 bits when stored, by defining a storage space containing 11 bits and a storage unit of a target status bit, a corresponding number of storage units are allocated to each network message according to the message length information. Compared with the related technology of storing message length information with a fixed storage space size, the utilization rate of the storage space can be improved, and the problem of storage space waste is effectively solved.

[0078] In one embodiment, when the message length is less than 2048 bits, after the message length information is written into the storage unit, the designated status bit of the database entry may be updated.

[0079] Before writing the message length information, if the designated status bit is in an unaligned state, after writing the message length information to the storage unit, since the last used byte is fully used and the used bytes are aligned with the written data, the designated status bit can be updated to an aligned state.

[0080] Before writing the message length information, if the specified status bit is in the aligned state, after writing the message length information to the storage unit, since the last used byte only uses the first 4 bits, the used bytes are not aligned with the written data, and therefore, the specified status bit can be updated to the unaligned state.

[0081] Through the above measures, after each time the message length information is written to the database entry, the specified status bit can be updated accordingly to indicate whether the last used byte is completely used, which is convenient for the subsequent storage process.

[0082] In one embodiment, see Figure 4, is a flow chart of a method for storing message length information provided by another embodiment of the present application, such as Figure 4 As shown, the method may include the following steps 410 to 440.

[0083] Step 410: If the message length indicated by the message length information is not less than 2048 bits, check the specified status bit of the database entry corresponding to the target network message.

[0084] After executing step 310, if the message length indicated by the message length information is not less than 2048 bits, step 410 may be executed to check the specified status bit.

[0085] Step 420: Construct two storage cells within the database entry based on the specified state bits.

[0086] After checking for a specified status bit, two storage locations may be constructed in the database entry to accommodate the specified status bit.

[0087] In one embodiment, if the designated status bit is in the aligned state, it means that the last used byte of the database entry has all belonged to the last used storage unit. In this case, two storage units can be constructed with three unused bytes after the last used byte of the database entry. The first storage unit includes the first unused byte and the first 4 bits of the second unused byte, and the second storage unit includes the last 4 bits of the second unused byte and the third unused byte.

[0088] If the specified status bit is in the unaligned state, it means that the last 4 bits of the last used byte of the database entry have not been written with data. In this case, the last 4 bits of the last used byte of the database entry and the three unused bytes after the last byte can be used to construct two storage units. The first storage unit includes the last 4 bits of the last used byte and the first unused byte, and the second storage unit includes the second unused byte and the first 4 bits of the third unused byte. The last 4 bits of the third unused byte do not belong to the second storage unit.

[0089] Step 430: Split the message length information into first sub-information and second sub-information, and write the first sub-information into the first storage unit and the second sub-information into the second storage unit; wherein the first sub-information includes the first 11 bits of data in the message length information, and the second sub-information is the data after deducting the first sub-information from the message length information.

[0090] After constructing two storage units, the message length information can be split into first sub-information and second sub-information. The first sub-information is the first 11 bits of data in the message length information, which is 2047 in decimal. The second sub-information is the value of the message length information minus the data of the first sub-information.

[0091] The first sub-information is written into the first storage unit, occupying 11 bits of the first storage unit. The second sub-information is written into the second storage unit.

[0092] Step 440: Set the target state position of the first storage unit to the continuation state, and set the target state position of the second storage unit to the non-continuation state.

[0093] After the first sub-information is written into the first storage unit, there is still the second sub-information in the message length information that has not been stored completely, so the target state bit of the first storage unit can be set to the continuation state. After the second sub-information is written into the second storage unit, the message length information is written completely, so the target state bit of the second storage unit can be set to the non-continuation state.

[0094] Through this measure, when the message length indicated by the message length information is greater than or equal to 2048, two storage units can be allocated for storing the message length information. Since only a small number of network messages have a message length of 2048 bits, two storage units are specifically allocated for such network messages, so that the message length information can be effectively stored.

[0095] In one embodiment, when the message length is not less than 2048 bits, after the message length information is written into the storage unit, the designated status bit of the database entry may be updated.

[0096] Before writing the message length information, if the specified status bit is in the unaligned state, after writing the message length information to the storage unit, since the last used byte only uses the first 4 bits, the used bytes are not aligned with the written data, so the specified status bit can be updated to the unaligned state. Here, although the update process does not change the content of the specified status bit, the update indicates that the current database entry is not aligned.

[0097] Before writing the message length information, if the designated status bit is in the aligned state, after writing the message length information to the storage unit, since the last used byte is fully used and the used byte is aligned with the written data, the designated status bit can be updated to the aligned state. Here, although the update process does not change the content of the designated status bit, the update indicates that the current database entry has been aligned.

[0098] Through the above measures, after each time the message length information is written to the database entry, the specified status bit can be updated accordingly to indicate whether the last used byte is completely used, which is convenient for the subsequent storage process.

[0099] See also Figure 5 , is a schematic diagram of the overall flow of a method for storing message length information provided in an embodiment of the present application, such as Figure 5 As shown, after obtaining the storage request for the message length information, it can be determined whether the message length indicated by the message length information reaches 2048 bits.

[0100] If not reached, the designated status bit of the database entry may be checked for alignment. On the one hand, if not aligned, a storage unit may be constructed in the database entry, the storage unit including the last 4 bits of the last used byte in the database entry and an unused byte after the last used byte. On the other hand, if aligned, a storage unit may be constructed with two unused bytes after the last used byte of the database entry, the storage unit including the first unused byte and the first 4 bits of the second unused byte.

[0101] If it is reached, the designated status bit of the database entry can be checked to see if it is an aligned state. On the one hand, if it is not an aligned state, two storage units can be constructed with three unused bytes in the database entry, and the first storage unit includes the last 4 bits of the last used byte and the first unused byte in the database entry, and the second storage unit includes the second unused byte and the first 4 bits of the third unused byte. On the other hand, if it is an aligned state, two storage units can be constructed with three unused bytes after the last used byte of the database entry.

[0102] After one or two storage units are constructed, the message length information may be written in the constructed storage unit and the designated status bit of the database entry may be updated.

[0103] See also Figure 6 , is a flow chart of a method for reading message length information provided in an embodiment of the present application, such as Figure 6 As shown, when a read request for message length information of a specified network message is obtained, the specified network message can be determined as the nth network message in the data stream in response to the read request, where n is a positive integer. Generally, the sequence number n of the specified network message in the data stream can be parsed from the read request. When responding to the read request, the retrieval count can be set to 0.

[0104] Based on the source address, destination address and protocol number of the specified network message, the data stream in which it is located is determined, and then the database entry corresponding to the data stream is found in the database. In the database entry, three bytes of data can be read cyclically, in other words, three bytes of data are read each time to execute the subsequent process. Before the message length information of the specified network message is read, if three bytes of data cannot be read, it can be considered that the message length information of the specified network message is not stored in the database entry. At this time, the reading process can be terminated and a read failure prompt message can be returned.

[0105] Each time three bytes of data are read, the 4th bit of the second byte and the 8th bit of the third byte can be checked to see if they record a non-continuation state. In other words, check whether the 4th bit of the second byte and the 8th bit of the third byte are 1. After each non-continuation state is checked, it can be determined that a complete message length information is read, and at this time, the search count can be increased by one. After processing three bytes of data, the next three bytes of data can be read in the database entry.

[0106] When the search count is n-1, it can be determined that the subsequently read data is the message length information of the nth network message, so the subsequently read data can be saved to the designated reading position. Here, the designated reading position can be configured as needed to save the message length information of the designated network message determined during the reading process.

[0107] When reading the message length information of the nth network message, the 4th bit of the second byte and the 8th bit of the third byte can also be checked respectively to see if the non-continuation state is recorded, and the search count is increased by one after the non-continuation state is detected. When the search count is n, it can be determined that the data subsequently read is not the message length information of the nth network message. In this case, the target state bit can be removed from the data read in the specified read position to generate the message length information of the specified network message. In one case, the specified read position includes data of a storage unit, the 12th bit can be removed, and the message length information is determined based on the data of the first 11 bits. In another case, the specified read position includes data of two storage units, the 12th bit and the 24th bit can be removed, and the first sub-information is determined based on the data of the first 11 bits, and the second sub-information is determined based on the data of the 13th to 23rd bits, and the first sub-information and the second sub-information are added to obtain the message length information.

[0108] Through this measure, the present application provides a message length information reading method adapted to the message length information storage method of the present application, which can accurately read the message length information of the specified network message from the database entry corresponding to the data stream according to the sequence number of the specified network message in the data stream.

[0109] Figure 7 is a block diagram of a storage device for message length information according to an embodiment of the present invention. Figure 7 As shown, the device may include:

[0110] A determination module 710, configured to determine, in response to a storage request for message length information of a target network message, whether a message length indicated by the message length information is not less than 2048 bits;

[0111] The checking module 720 is used for checking the specified state bit of the database entry corresponding to the data flow where the target network message is located if no; wherein the specified state bit is an unaligned state or an aligned state;

[0112] A construction module 730, configured to construct a storage unit in the database entry based on the specified state bit; wherein the storage unit includes 12 bits, the 12th bit of the storage unit is a target state bit, and the target state bit is a non-continuation state or a continuation state;

[0113] The storage module 740 is used to write the message length information into the storage unit and set the target state position of the storage unit to a non-continuation state.

[0114] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method for storing message length information, which will not be repeated here.

[0115] In several embodiments provided in the present application, the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0117] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

Claims

1. A method for storing message length information, It is characterized in that include: In response to a storage request for message length information of a target network message, determining whether a message length indicated by the message length information is not less than 2048 bits; If not, checking a specified state bit of a database entry corresponding to the data flow where the target network message is located; wherein the specified state bit is an unaligned state or an aligned state; Constructing a storage unit in the database entry based on the specified state bit; wherein the storage unit includes 12 bits, the 12th bit of the storage unit is a target state bit, and the target state bit is a non-continuation state or a continuation state; The message length information is written into the storage unit, and the target state position of the storage unit is set to a non-continuation state.

2. The method according to claim 1, It is characterized in that The step of constructing a storage unit in the database entry based on the specified status bit comprises: If the designated state bit is in an unaligned state, constructing the last 4 bits of the last used byte of the database entry and another unused byte after the last used byte into a storage unit; If the specified state bit is the alignment state, a storage unit is constructed with two unused bytes after the last used byte of the database entry; wherein the first 4 bits of the second unused byte belong to the storage unit.

3. The method according to claim 2, It is characterized in that The method further comprises: If the designated state bit is in an unaligned state, after writing the message length information into the storage unit, updating the designated state bit to an aligned state; If the designated state bit is in the aligned state, after the message length information is written into the storage unit, the designated state bit is updated to the unaligned state.

4. The method according to claim 1, It is characterized in that The method further comprises: If the message length indicated by the message length information is not less than 2048 bits, checking a specified status bit of a database entry corresponding to the target network message; constructing two storage locations within the database entry based on the specified status bits; Splitting the message length information into first sub-information and second sub-information, and writing the first sub-information into a first storage unit and writing the second sub-information into a second storage unit; wherein the first sub-information includes the first 11 bits of data in the message length information, and the second sub-information is the data obtained by subtracting the first sub-information from the message length information; The target state position of the first storage unit is set to a continuation state, and the target state position of the second storage unit is set to a non-continuation state.

5. The method according to claim 4, It is characterized in that The constructing two storage units in the database entry based on the specified state bit comprises: If the specified state bit is an aligned state, two storage units are constructed with three unused bytes after the last used byte of the database entry; If the designated status bit is in an unaligned state, the last 4 bits of the last used byte of the database entry and the three unused bytes after the last used byte construct two storage units; wherein the first 4 bits of the third unused byte belong to the second storage unit.

6. The method according to claim 5, It is characterized in that The method further comprises: If the designated state bit is in an unaligned state, after writing the message length information into the storage unit, updating the designated state bit to an unaligned state; If the designated status bit is the aligned status, after the message length information is written into the storage unit, the designated status bit is updated to the aligned status.

7. The method according to claim 1, It is characterized in that The method further comprises: In response to a read request for message length information of a specified network message, determining that the specified network message is the nth network message in the data stream in which it is located by using the read request; wherein n is a positive integer; In the database entry corresponding to the data stream where the designated network message is located, three bytes of data are read cyclically, and the fourth bit of the second byte and the eighth bit of the third byte are checked respectively to see whether a non-continuation state is recorded; After each non-continuation state is detected, the search count is increased by one; wherein the initial value of the search count is 0; When the search count is n-1, the subsequently read data is saved to the specified reading position; When the search count is n, stop reading data, remove the target status bit of the read data in the designated reading position, and generate the message length information of the designated network message.

8. A storage device for message length information, It is characterized in that include: A judgment module, configured to judge, in response to a storage request for message length information of a target network message, whether the message length indicated by the message length information is not less than 2048 bits; A checking module, for checking, if not, a specified status bit of a database entry corresponding to the data flow where the target network message is located; wherein the specified status bit is an unaligned state or an aligned state; A construction module, configured to construct a storage unit in the database entry based on the specified state bit; wherein the storage unit includes 12 bits, the 12th bit of the storage unit is a target state bit, and the target state bit is a non-continuation state or a continuation state; The storage module is used to write the message length information into the storage unit and set the target state position of the storage unit to a non-continuation state.

9. An electronic device, It is characterized in that The electronic device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method for storing message length information as described in any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and the computer program can be executed by a processor to complete the method for storing message length information as described in any one of claims 1 to 7.