Message storage method and device, electronic equipment and storage medium

By only storing the preset flow identifier and sequence number in the packets returned by the network tester, the problem of large packet storage space occupied in the existing technology is solved, the purpose of saving storage space and computing resources is achieved, and it is suitable for applications with heavy traffic. application scenarios.

CN118740663APending Publication Date: 2024-10-01BEIJING XINERTEL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410761057.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The message storage method in the existing technology leads to excessive consumption of storage space and computing resources, especially in a multi-port real-time packet capture scenario, the transmission bandwidth becomes a bottleneck.

Method used

By receiving, parsing and verifying the target packets returned by the network tester, only the preset flow identifier and packet sequence number are stored, and this information is used to restore the network traffic packets and avoid storing the entire packet content.

Benefits of technology

It saves storage space and computing resources, is suitable for application scenarios with large traffic packets, and reduces the cost of transmission bandwidth and storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740663A_ABST
    Figure CN118740663A_ABST
Patent Text Reader

Abstract

The invention provides a message storage method and device, electronic equipment and a storage medium, and relates to the technical field of network tests.The method comprises the steps that a target message is received, and the target message is a message returned by tested equipment after a network tester sends a network flow message to the tested equipment; analyzing the target message to obtain an analysis result, the analysis result being used for representing whether the target message contains a preset flow identifier and a preset message serial number; when the analysis result shows that the target message contains the preset flow identifier and the preset message serial number, performing legality verification on the target message; and when it is determined that the target message is a legal message, a preset flow identifier and a preset message serial number are stored, and the preset flow identifier is used for restoring the network flow message. By implementing the technical scheme provided by the invention, the problem that a large amount of storage space is occupied in a message storage method in the related technology 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 network testing technology, and in particular to a message storage method, device, electronic device and storage medium. Background Art

[0002] In the field of network testing, when processing and storing network traffic messages, two main problems are usually encountered: a large amount of storage space is occupied and the consumption of processing computing resources. This is mainly because the currently commonly used message storage method, such as the pcap format, will save the entire message content, which undoubtedly increases the consumption of storage space and computing resources. When realizing the capture function of the network tester, it is necessary to transmit the message received by the background board to the front-end tester in order to realize the display, analysis and diagnosis functions of the message. However, the method in the related art is usually to transmit the entire message content, which undoubtedly occupies a large amount of transmission bandwidth. Especially when the instrument has multiple ports for real-time packet capture, the transmission bandwidth will become the biggest bottleneck. It can be seen that the message storage method in the related art has the problem of a large amount of storage space being occupied.

[0003] The message storage method in the related art has the problem that a large amount of storage space is occupied, and no effective solution has been proposed yet. Summary of the invention

[0004] The present application provides a message storage method, device, electronic device and storage medium to at least solve the problem of a large amount of storage space being occupied by the message storage method in the related art.

[0005] In a first aspect, the present application provides a message storage method, comprising: receiving a target message, wherein the target message is a message returned by a device under test after a network tester sends a network traffic message to the device under test; parsing the target message to obtain a parsing result, wherein the parsing result is used to indicate whether the target message contains a preset flow identifier and a preset message sequence number, the network traffic message includes a preset flow identifier and a preset message sequence number, the preset flow identifier is used to indicate the type of the network traffic message, and the preset message sequence number is used to indicate the sequence number corresponding to the network traffic message; when the parsing result indicates that the target message contains the preset flow identifier and the preset message sequence number, performing a validity check on the target message; when it is determined that the target message is a legitimate message, storing the preset flow identifier and the preset message sequence number, wherein the preset flow identifier is used to restore the network traffic message.

[0006] By adopting the above technical solution, the network tester receives the target message sent by the device under test, parses the target message, obtains the parsing result, and determines whether the target message contains the preset flow identifier and the preset message sequence number according to the parsing result. When it is determined that the target message contains the preset flow identifier and the preset message sequence number, the legality of the target message is verified. When it is determined that the target message is a legal message, the preset flow identifier and the preset message sequence number are stored. The preset flow identifier can be used to restore the network traffic message, and the network traffic message corresponding to the preset message sequence number can be restored. This avoids the problem of large storage space occupation caused by the method of storing the entire message content in the related art, achieves the purpose of saving storage space, and can also achieve the purpose of reducing the consumption of computing resources. It is suitable for application scenarios with more traffic messages.

[0007] Optionally, when the parsing result indicates that the target message contains a preset flow identifier and a preset message sequence number, the target message is checked for legitimacy, including: when the parsing result indicates that the target message contains a preset flow identifier and a preset message sequence number, the target message is checked for legitimacy according to preset protocol rules.

[0008] By adopting the above technical solution, when the parsing result indicates that the target message contains the preset flow identifier and the preset message sequence number, the target message is verified for legitimacy according to the preset protocol rules, thereby achieving the purpose of verifying the legitimacy of the target message.

[0009] Optionally, after storing the preset flow identifier and the preset message sequence number, the method further includes: generating a network traffic message based on the preset flow identifier and the preset message sequence number.

[0010] By adopting the above-mentioned technical scheme, network traffic messages can also be generated based on the preset flow identifier and the preset message sequence number. That is, when it is necessary to view the message, the network traffic message can be generated based on the preset flow identifier and the preset message sequence number. Therefore, when storing, only the preset flow identifier and the preset message sequence number need to be stored, and there is no need to store the entire message content, thereby achieving the purpose of saving storage space.

[0011] Optionally, based on a preset flow identifier and a preset message sequence number, a network traffic message is generated, including: searching for target traffic configuration information corresponding to the preset flow identifier based on a pre-established flow configuration information table, wherein the flow configuration information table records the relationship between different flow identifiers and corresponding traffic configuration information; and generating a network traffic message corresponding to the preset message sequence number according to the target traffic configuration information and the preset flow identifier.

[0012] By adopting the above technical solution, the target traffic configuration information corresponding to the preset flow identifier can be found based on the pre-established flow configuration information table, and then the network traffic message corresponding to the preset message sequence number can be generated according to the target traffic configuration information and the preset flow identifier, thereby achieving the purpose of restoring the network traffic message.

[0013] Optionally, the above method further includes: storing the target message when it is determined that the target message is an illegal message.

[0014] By adopting the above technical solution, when it is determined that the target message is an illegal message, the target message is stored. That is, when the target message is not a legal network traffic message, the target message is stored.

[0015] Optionally, the method further includes: storing the target message when the parsing result indicates that the target message does not contain a preset flow identifier and a preset message sequence number.

[0016] By adopting the above technical solution, when the target message does not contain the preset flow identifier and the preset message sequence number, the target message is stored, that is, when the target message is not a network flow message, the target message is stored.

[0017] Optionally, before receiving the target message, the above method also includes: sending a network traffic message to the device under test, wherein the network traffic message is generated based on target traffic configuration information, and the target traffic configuration information is used to represent a rule for generating the network traffic message.

[0018] By adopting the above technical solution, the network tester can generate a network traffic message based on the target traffic configuration information before receiving the target message, that is, it can generate a network traffic message based on certain rules, and then send the network traffic message to the device under test.

[0019] In the second aspect of the present application, a message storage device is also provided, including: a receiving module, used to receive a target message, wherein the target message is a message returned by the device under test after the network tester sends a network traffic message to the device under test; a parsing module, used to parse the target message and obtain a parsing result, wherein the parsing result is used to indicate whether the target message contains a preset flow identifier and a preset message sequence number, the network traffic message includes a preset flow identifier and a preset message sequence number, the preset flow identifier is used to indicate the type of the network traffic message, and the preset message sequence number is used to indicate the sequence number corresponding to the network traffic message; a verification module, used to perform a legitimacy check on the target message when the parsing result indicates that the target message contains the preset flow identifier and the preset message sequence number; a first storage module, used to store the preset flow identifier and the preset message sequence number when it is determined that the target message is a legal message, wherein the preset flow identifier is used to restore the network traffic message.

[0020] In a third aspect of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, any one of the above methods is implemented.

[0021] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the above-described methods is executed.

[0022] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. It avoids the problem of large storage space occupation caused by the method of storing the entire message content in related technologies, achieves the purpose of saving storage space, and can also achieve the purpose of reducing the consumption of computing resources. It is suitable for application scenarios with more traffic messages.

[0023] 2. The purpose of restoring network traffic messages can be achieved based on the flow identifier and message sequence number. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flowchart of a message storage method provided in an embodiment of the present application; Figure 2 is a schematic diagram of a test application scenario provided in an embodiment of the present application; Figure 3 This is a schematic diagram of a message receiving process provided by an embodiment of the present application; Figure 4 This is a schematic diagram of a message restoration process provided by an embodiment of the present application; Figure 5 This is a structural block diagram of a message storage device provided in an embodiment of the present application; Figure 6 It is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application.

[0025] Description of reference numerals: 600 - electronic device; 601 - processor; 602 - communication bus; 603 - user interface; 604 - network interface; 605 - memory. DETAILED DESCRIPTION

[0026] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0027] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.

[0028] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0029] This application provides a message storage method, referring to Figure 1 , Figure 1 It is a flow chart of a message storage method provided in an embodiment of the present application, comprising the following steps: Step S101, receiving a target message, wherein the target message is a message returned by the device under test after the network tester sends a network traffic message to the device under test; Step S102, parsing the target message to obtain a parsing result, wherein the parsing result is used to indicate whether the target message contains a preset flow identifier and a preset message sequence number, the network flow message includes a preset flow identifier and a preset message sequence number, the preset flow identifier is used to indicate the type of the network flow message, and the preset message sequence number is used to indicate the sequence number corresponding to the network flow message; Step S103, when the parsing result indicates that the target message contains a preset flow identifier and a preset message sequence number, the target message is subjected to a validity check; Step S104: when it is determined that the target message is a legitimate message, a preset flow identifier and a preset message sequence number are stored, wherein the preset flow identifier is used to restore the network traffic message.

[0030] Through the above steps, the network tester receives the target message sent by the device under test, parses the target message, obtains the parsing result, and determines whether the target message contains the preset flow identifier and the preset message sequence number according to the parsing result. When it is determined that the target message contains the preset flow identifier and the preset message sequence number, the legality of the target message is verified. When it is determined that the target message is a legal message, the preset flow identifier and the preset message sequence number are stored. This avoids the problem of large storage space occupation caused by the method of storing the entire message content in the related art, achieves the purpose of saving storage space, and can also achieve the purpose of reducing the consumption of computing resources. It is suitable for application scenarios with more traffic messages.

[0031] The execution subject of the above steps may be a network tester or other equipment.

[0032] In the above embodiment, the network tester receives a target message sent by the device under test. The target message may be a message returned by the device under test after the network tester sends a network traffic message to the device under test. For example, the device under test may be a switch. The network traffic message may be used to test network performance, such as network speed, bandwidth, delay, packet loss rate and other performance. The target message is parsed to obtain a parsing result. According to the parsing result, it is determined whether the target message contains a preset flow identifier and a preset message sequence number. The preset flow identifier may be used to identify the type of the network traffic message. When it is determined that the target message contains the preset flow identifier and the preset message sequence number, the legitimacy of the target message is verified. For example, the legitimacy of the target message is verified according to the protocol rules. The protocol may be a communication protocol observed by both parties. When it is determined that the target message is a legal message, the preset flow identifier and the preset message sequence number are stored. In actual applications, network traffic messages may include one or more messages, that is, one flow may include one or more messages, and each message has a corresponding flow identifier and message sequence number; the network tester can restore the network traffic message according to the stored preset flow identifier and preset message sequence number, so there is no need to store the entire message content. This avoids the problem of large storage space occupation caused by the method of storing the entire message content in related technologies, achieves the purpose of saving storage space, and can also achieve the purpose of reducing the consumption of computing resources, which is suitable for application scenarios with more traffic messages.

[0033] In an optional embodiment, when the parsing result indicates that the target message contains a preset flow identifier and a preset message sequence number, the target message is verified for legitimacy, including: when the parsing result indicates that the target message contains a preset flow identifier and a preset message sequence number, the target message is verified for legitimacy according to preset protocol rules.

[0034] In the above embodiment, when the parsing result indicates that the target message contains a preset flow identifier and a preset message sequence number, the target message is verified for legitimacy according to the preset protocol rules, for example, the target message is verified for legitimacy according to the communication protocol rules observed by both parties. The purpose of verifying the legitimacy of the target message is achieved.

[0035] In an optional embodiment, after storing the preset flow identifier and the preset message sequence number, the method further includes: generating a network traffic message based on the preset flow identifier and the preset message sequence number.

[0036] In the above embodiment, network traffic messages can also be generated based on preset flow identifiers and preset message sequence numbers. For example, when it is necessary to view captured messages, network traffic messages can be generated based on preset flow identifiers and preset message sequence numbers, thus achieving the purpose of restoring network traffic messages. In practical applications, a network tester can generate network traffic messages based on preset flow identifiers, or can generate network traffic messages through a test PC connected to the network tester, and users can view messages on the test PC. Therefore, when storing, only the preset flow identifier and preset message sequence number need to be stored, and the entire message content does not need to be stored, thus achieving the purpose of saving storage space.

[0037] In an optional embodiment, a network traffic message is generated based on a preset flow identifier and a preset message sequence number, including: searching for target traffic configuration information corresponding to the preset flow identifier based on a pre-established flow configuration information table, wherein the flow configuration information table records the relationship between different flow identifiers and corresponding traffic configuration information; and generating a network traffic message corresponding to the preset message sequence number based on the target traffic configuration information and the preset flow identifier.

[0038] In the above embodiment, the target traffic configuration information corresponding to the preset flow identifier can be found based on the pre-established flow configuration information table. In actual applications, according to the test needs, the user can perform different traffic configurations and generate corresponding network traffic packets according to different traffic configurations. For example, a single flow can be generated, which can include one packet or multiple packets, and a continuous flow can also be generated. The target traffic configuration information may include relevant configuration information for generating network traffic packets, and then a network traffic packet corresponding to the preset message sequence number is generated according to the target traffic configuration information and the preset flow identifier, thereby achieving the purpose of restoring the network traffic packet.

[0039] In an optional embodiment, the above method further includes: storing the target message when it is determined that the target message is an illegal message.

[0040] In the above embodiment, when it is determined that the target message is an illegal message, the target message is stored. That is, when the target message is not a legal network traffic message, the target message is stored. For example, when the target message is checked, there may be an error, and the target message (or the original message) is stored.

[0041] In an optional embodiment, the method further includes: storing the target message when the parsing result indicates that the target message does not include the preset flow identifier and the preset message sequence number.

[0042] In the above embodiment, when the target message does not contain the preset flow identifier and the preset message sequence number, the target message is stored. That is, when the target message is not a network traffic message, the target message is stored. For example, the target message may not be a network traffic message, but a low-speed protocol message.

[0043] In an optional embodiment, before receiving the target message, the above method also includes: sending a network traffic message to the device under test, wherein the network traffic message is generated based on the target traffic configuration information, and the target traffic configuration information is used to represent the rules for generating the network traffic message.

[0044] In the above embodiment, before receiving the target message, the network tester can generate a network traffic message based on the target traffic configuration information. The target traffic configuration information is used to represent the generation rule of the network traffic message. Before sending the network traffic message to the device under test, the network tester can generate the network traffic message based on the target traffic configuration information. That is, the network traffic message can be generated based on certain rules and then sent to the device under test.

[0045] Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application will be described in detail below in conjunction with specific embodiments.

[0046] In view of the main problems of large storage space occupation and high transmission bandwidth requirements for message processing during network testing in the related art, the embodiment of the present application proposes a message transmission and storage method based on flow classification. This method does not need to save the complete message content, but only needs to save the information related to the flow, which can greatly reduce the bandwidth and storage space occupied by message transmission. At the same time, since only the flow information is saved, network traffic messages can also be processed and stored more quickly. This is of great significance for the implementation of network testers and the analysis and diagnosis of network traffic. It ensures data integrity while improving real-time performance, so that the network tester design can meet the needs of more ports. The embodiments of the present application are described in detail below.

[0047] Figure 2It is a schematic diagram of the test application scenario provided in the embodiment of the present application. The network tester can send network traffic messages to the device under test, receive messages returned by the device under test, and then analyze the network situation based on the received messages. In the embodiment of the present application, the network tester can only save the traffic information related to the network traffic messages, without saving the entire message content. The test PC is connected to the network tester, and the messages can be viewed and captured through the test PC.

[0048] The network tester traffic generation scheme is as follows: the tester traffic (or data stream, or simply stream) is generated through user configuration information, including stream template (including basic data content and format), jump (position, step, increasing, decreasing, random, etc.), Checksum (position, jump type, etc.), payload information (value, fixed, increasing, decreasing, random, etc.), packet length (value, fixed, increasing, decreasing, random, etc.) and other information. These information are configured by software to the logic device. The logic generates the message rules and generates the specific message traffic repeatedly at a certain rate according to the user-configured information. Each stream sent contains a label field (stream id, sequence no, check, timestamp, etc.). The label field is generally used as the identifier of the flow classification. When receiving, this flow classification is used as the identifier of the flow statistics.

[0049] In actual applications, users can choose different modes when configuring traffic. For example, they can generate only one stream, multiple streams, or continuous streams, such as a network tester that continuously sends streams. They can also set the number of packets in a stream, as well as the interval time between different streams.

[0050] The following is an explanation based on the application scenarios of real-time message capture and message storage: Figure 3 This is a schematic diagram of a message receiving process provided by an embodiment of the present application, and the process includes: S301, receiving a message; S302, parsing the label field: after receiving the message, parsing the label field; S303, if the parsing fails, it is a common message, and the original message content is saved, and then the process goes to step S309; S304: If the analysis is successful, it is a legal flow message, and the process goes to step S305; S305: parse and obtain the stream id and sequence no. S306, checking the legitimacy of the message according to the protocol rules; S307, if the verification fails, save the original message content; S308, if the verification is passed, the message content is consistent with the generated one, and only the stream id and sequence number need to be saved; S309, processing completed.

[0051] During real-time capture, the flow configuration information is available in the foreground, which can be used directly when restoring the message. If the message is stored, the flow configuration information also needs to be saved.

[0052] Figure 4 This is a schematic diagram of a message restoration process provided by an embodiment of the present application, and the process includes: S401, first perform type judgment; S402, when it is determined that it is an original message, the original message can be used directly; that is, when it is not a stream message, it can be used directly; then the process ends, that is, entering step S406; S403, when it is determined that it is a stream message, use the stream id to find the corresponding traffic configuration information; S404, simulating a specific message generation process according to a message generation rule; S405, a message corresponding to sequence no can be obtained; S406, processing completed.

[0053] The flow message restoration process of the embodiment of the present application is roughly as follows: according to the flow generation method, a stream id corresponds to a unique flow configuration information, and the sequence number corresponds to the number of messages generated. Then, when the software knows all the flow configuration information configured by the user, it uses the stream id and sequence number, and simulates the generation process of a specific message according to the message generation rule to obtain a specific message.

[0054] Through the embodiments of the present application, in application scenarios with a large number of traffic messages, the overhead of message transmission and storage space can be effectively reduced. For example, the stream message only uses 8 bytes (stream id and sequence no) to replace the entire message, so the longer the message length, the more obvious the effect. Calculated based on the minimum packet length of 64 bytes, the compression ratio is (64 - 8) / 64 × 100% = 87.5%. Calculated based on the longest Ethernet message length, the compression ratio = (1518 - 8) / 1518 × 100% = 99.9%. In application scenarios with a large number of traffic messages, the effect of reducing message transmission and storage space is obvious. This technical solution can reduce the cost of setting up the test environment, enhance the flexibility of switching the application environment, expand the scope of test capabilities, and ensure that the network is tested and verified more fully and efficiently.

[0055] In an embodiment of the present application, a method for restoring a message based on a flow generation rule is proposed. This method only retains the flow information when capturing and storing the message, but does not save the entire message content. In application scenarios with a large number of traffic messages, this method can effectively reduce the bandwidth and storage space occupied by message transmission.

[0056] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0057] The present application also provides a message storage device, such as Figure 5 As shown, Figure 5 This is a structural block diagram of a message storage device provided in an embodiment of the present application, the device comprising: The receiving module 501 is used to receive a target message, wherein the target message is a message returned by the device under test after the network tester sends a network traffic message to the device under test; The parsing module 502 is used to parse the target message and obtain a parsing result, wherein the parsing result is used to indicate whether the target message contains a preset flow identifier and a preset message sequence number, the network flow message includes a preset flow identifier and a preset message sequence number, the preset flow identifier is used to indicate the type of the network flow message, and the preset message sequence number is used to indicate the sequence number corresponding to the network flow message; A verification module 503, configured to verify the legitimacy of the target message when the parsing result indicates that the target message contains a preset flow identifier and a preset message sequence number; The first storage module 504 is used to store a preset flow identifier and a preset message sequence number when it is determined that the target message is a legitimate message, wherein the preset flow identifier is used to restore the network traffic message.

[0058] In an optional embodiment, the verification module 503 includes: a verification unit, configured to verify the legality of the target message according to a preset protocol rule when the parsing result indicates that the target message contains a preset flow identifier and a preset message sequence number.

[0059] In an optional embodiment, the above-mentioned device also includes: a generation module, which is used to generate a network traffic message based on the preset flow identifier and the preset message sequence number after storing the preset flow identifier and the preset message sequence number.

[0060] In an optional embodiment, the above-mentioned generation module includes: a search unit, used to search for target traffic configuration information corresponding to a preset flow identifier based on a pre-established flow configuration information table, wherein the flow configuration information table records the relationship between different flow identifiers and corresponding traffic configuration information; a generation unit, used to generate a network traffic message corresponding to a preset message sequence number based on the target traffic configuration information and the preset flow identifier.

[0061] In an optional embodiment, the above-mentioned device further includes: a second storage module, configured to store the target message when it is determined that the target message is an illegal message.

[0062] In an optional embodiment, the above-mentioned device further includes: a third storage module, configured to store the target message when the parsing result indicates that the target message does not contain the preset flow identifier and the preset message sequence number.

[0063] In an optional embodiment, the above-mentioned device also includes: a sending module, used to send a network traffic message to the device under test before receiving the target message, wherein the network traffic message is generated based on the target traffic configuration information, and the target traffic configuration information is used to represent the rules for generating the network traffic message.

[0064] The present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed, any one of the method steps described above is executed.

[0065] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0066] The present application also discloses an electronic device. Figure 6 As shown, Figure 6 The electronic device 600 may include: at least one processor 601 , at least one network interface 604 , a user interface 603 , a memory 605 , and at least one communication bus 602 .

[0067] The communication bus 602 is used to realize the connection and communication between these components.

[0068] The user interface 603 may include a display screen (Display) and a camera (Camera). The optional user interface 603 may also include a standard wired interface and a wireless interface.

[0069] The network interface 604 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0070] Among them, the processor 601 may include one or more processing cores. The processor 601 uses various interfaces and lines to connect various parts of the entire electronic device (such as a server), and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 605, and calling data stored in the memory 605. Optionally, the processor 601 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 601 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 601, and it can be implemented separately through a chip.

[0071] Among them, the memory 605 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 605 includes a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 605 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 605 may optionally also be at least one storage device located away from the aforementioned processor 601. Refer to Figure 6 , the memory 605 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program of a message storage method.

[0072] exist Figure 6 In the electronic device 600 shown, the user interface 603 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 601 can be used to call an application program of a message storage method stored in the memory 605, and when executed by one or more processors 601, the electronic device 600 executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0073] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0074] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0075] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0076] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0077] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0078] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.

[0079] This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field not recorded in the present disclosure.

Claims

1. A message storage method, It is characterized in that include: Receiving a target message, wherein the target message is a message returned by the device under test after the network tester sends a network traffic message to the device under test; Parsing the target message to obtain a parsing result, wherein the parsing result is used to indicate whether the target message includes a preset flow identifier and a preset message sequence number, the network traffic message includes the preset flow identifier and the preset message sequence number, the preset flow identifier is used to indicate the type of the network traffic message, and the preset message sequence number is used to indicate the sequence number corresponding to the network traffic message; When the parsing result indicates that the target message contains the preset flow identifier and the preset message sequence number, performing a validity check on the target message; In the case where it is determined that the target message is a legitimate message, the preset flow identifier and the preset message sequence number are stored, wherein the preset flow identifier is used to restore the network traffic message.

2. The method according to claim 1, It is characterized in that When the parsing result indicates that the target message contains the preset flow identifier and the preset message sequence number, performing a validity check on the target message includes: When the parsing result indicates that the target message contains the preset flow identifier and the preset message sequence number, the legitimacy of the target message is checked according to preset protocol rules.

3. The method according to claim 1, It is characterized in that After storing the preset flow identifier and the preset message sequence number, the method further includes: The network traffic message is generated based on the preset flow identifier and the preset message sequence number.

4. The method according to claim 3, It is characterized in that Generating the network traffic message based on the preset flow identifier and the preset message sequence number includes: Searching for target flow configuration information corresponding to the preset flow identifier based on a pre-established flow configuration information table, wherein the flow configuration information table records the relationship between different flow identifiers and corresponding flow configuration information; The network traffic message corresponding to the preset message sequence number is generated according to the target traffic configuration information and the preset flow identifier.

5. The method according to claim 1, It is characterized in that The method further comprises: When it is determined that the target message is an illegal message, the target message is stored.

6. The method according to claim 1, It is characterized in that The method further comprises: When the parsing result indicates that the target message does not include the preset flow identifier and the preset message sequence number, the target message is stored.

7. The method according to any one of claims 1 to 6, It is characterized in that Before receiving the target message, the method further includes: The network traffic message is sent to the device under test, wherein the network traffic message is generated based on target traffic configuration information, and the target traffic configuration information is used to represent a rule for generating the network traffic message.

8. A message storage device, It is characterized in that include: A receiving module, used for receiving a target message, wherein the target message is a message returned by the device under test after the network tester sends a network traffic message to the device under test; A parsing module, used to parse the target message to obtain a parsing result, wherein the parsing result is used to indicate whether the target message contains a preset flow identifier and a preset message sequence number, the network traffic message includes the preset flow identifier and the preset message sequence number, the preset flow identifier is used to indicate the type of the network traffic message, and the preset message sequence number is used to indicate the sequence number corresponding to the network traffic message; A verification module, configured to verify the legitimacy of the target message when the parsing result indicates that the target message contains the preset flow identifier and the preset message sequence number; The first storage module is used to store the preset flow identifier and the preset message sequence number when it is determined that the target message is a legal message, wherein the preset flow identifier is used to restore the network traffic message.

9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory. It is characterized in that When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is performed.