Data compression method and apparatus

By constructing a dictionary and grammar set to compress the trace logs of MPI programs in a targeted manner, the problems of low compression rate and long time in the existing technology are solved, and efficient data compression and storage is achieved, which is suitable for high concurrency and multi-node environments.

WO2024187944A1PCT designated stage expired Publication Date: 2024-09-19HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/072070
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-05
Filing Date
2024-01-12
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

When the existing technology compresses the trace log generated when the MPI program process is executed, the compression rate is low and the compression time is long, making it difficult to meet the needs of large-scale data storage and transmission.

Method used

By constructing a dictionary and grammar set that characterizes the function call records in the trace log, we perform targeted processing of different data in the trace log, including compression of function call records and time data, and the use of merging and removing redundancy of description information sets and grammar sets. , improve compression ratio and efficiency.

Benefits of technology

Significantly improves the compression rate and compression time of trace logs, saves storage resources and transmission bandwidth, and is suitable for high-concurrency process scenarios and multi-node cluster environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024072070_19092024_PF_FP_ABST
    Figure CN2024072070_19092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing, and discloses a data compression method and apparatus. The method comprises: acquiring a first trace log generated in a running process of a first process, each log record in the first trace log comprising a function call record of when the first process calls a communication function; constructing a first dictionary and a first grammar set according to the function call record in the first trace log, so as to compress the function call record in the first trace log. For a first function call record included in any log record in the first trace log, a first symbol string in the first dictionary is used to represent the first function call record, and a first grammar tree in the first grammar set is used to represent a function call relationship in the first function call record. By means of the present method, the compression rate during compression of trace logs can be increased, and the compression time can be shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Data compression method and device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 10, 2023, with application number 202310232866.4 and application name “A compression storage method for MPI communication computing records” and the Chinese patent application filed with the State Intellectual Property Office on May 5, 2023, with application number 202310498606.1 and application name “Data compression method and device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of data processing technology, and in particular to a data compression method and device. Background Art

[0003] Multiple processes may exchange data. For example, multiple processes belonging to the same task may exchange a large amount of data. Currently, data exchange between multiple processes can be achieved through the Message Passing Interface (MPI) protocol. In this case, the program executed by the process is an MPI-compliant program, referred to as an MPI program.

[0004] When performing performance analysis on an MPI program, performance analysis can be performed based on the communication records between the various processes executing the MPI program and the hardware performance data of the nodes when executing the MPI program. The communication records of the processes can generally be obtained by generating trace logs. When the scale of data exchanged between processes is large, the number of trace logs generated by the processes is also large. Therefore, the server can compress the large number of trace logs generated when the processes execute the MPI program, and then store or transmit the compressed trace logs locally for analysis. In this way, local storage resources can be saved.

[0005] Therefore, how to improve the compression rate of the trace logs generated when the process executes the MPI program and reduce the compression time has become an urgent problem to be solved.

[0006] Summary of the Invention

[0007] The present application provides a data compression method and apparatus, which can improve the compression rate when compressing a tracking log containing communication records and reduce the compression time.

[0008] To achieve the above objectives, this application provides the following technical solutions:

[0009] In a first aspect, the present application provides a data compression method. The method includes: obtaining a first trace log generated during the running of a first process, and constructing a first dictionary and a first grammar set based on the function call records in the first trace log to achieve compression of the function call records in the first trace log. The first trace log includes at least one log record, and each log record in the first trace log includes a function call record when the first process calls a communication function. The communication function is a function for communication. The first dictionary includes at least one symbol string, and the first grammar set includes at least one grammar tree. For the first function call record included in any log record in the first trace log, the first symbol string in the first dictionary is used to represent the first function call record, and the first grammar tree in the first grammar set is used to represent the function call relationship in the first function call record.

[0010] Compared to common compression methods, the method provided by this application takes into account the data characteristics of function call records in trace logs. For example, this application compresses trace logs by constructing a first dictionary that represents function call records in trace logs, and a first grammar set that represents function call relationships in function call records. Therefore, compared to common compression methods that do not consider the characteristics of trace log data, the method provided by this application achieves a high compression rate and shortens the compression time.

[0011] In a possible design, the communication function includes an MPI function.

[0012] Through this possible design, in the high-concurrency process scenario where the MPI protocol is currently widely used, the method of the present application can compress the trace logs generated in the scenario with a high compression rate.

[0013] In another possible design, the first dictionary further includes a first description information set, the first description information set including at least one description information item, the at least one description information item including description information for describing the semantics of each symbolic string in the first dictionary. When function call records in at least two log records in the first trace log have the same semantic structure, the symbolic string in the first dictionary used to represent the function call records in the at least two log records corresponds to a description information item in the first description information set.

[0014] Through this possible design, when the same process calls a communication function, the function call records in the multiple log records generated have the same or similar semantics. For example, these function call records include the same or similar types of parameters. Therefore, the semantics of the multiple symbol strings used to represent the function call records in the multiple log records may also be the same. In this way, by making the multiple symbol strings in the first dictionary that represent the function call records with the same semantics in the multiple log records correspond to a piece of description information in the first description information set, the compression rate of the function call records in the trace log can be further improved.

[0015] In another possible design, when the first process is a process of a target application, and the target application also includes a second process, and function call records in a second trace log generated during the execution of the second process are compressed to obtain a second dictionary including a second description information set, the method further includes: when it is determined that the number of different description information in the first description information set and the second description information set exceeds a threshold, compressing the first description information set and the second description information set based on the textual similarity of the different description information in the first description information set and the second description information set.

[0016] When the target application includes multiple processes, through this possible design, when compressing the trace logs generated by the multiple processes, the larger number of different descriptive information in the dictionary corresponding to the multiple processes can be de-redundant (or understood as deduplicated) and compressed, which can further improve the compression rate when compressing the trace logs generated by the multiple processes.

[0017] In another possible design, the method further includes: when it is determined that the amount of different description information in the first description information set and the second description information set is less than a threshold, merging the first description information set and the second description information set.

[0018] When the target application includes multiple processes, when compressing the trace logs generated by the multiple processes, if the number of different description information in the dictionaries corresponding to the multiple processes is small, then through this possible design, a simple merging operation can be directly performed on the multiple description information sets of the multiple processes. This can save the compression time when compressing the trace logs generated by the multiple processes to a certain extent.

[0019] In another possible design, when the first process is a process of a target application, the target application also includes a second process, and a second grammar set is obtained after compressing function call records in a second trace log generated during the execution of the second process, the method further includes: merging the first grammar set and the second grammar set based on function communication between the first process and the second process.

[0020] When the target application includes multiple processes, through this possible design, multiple grammar sets corresponding to the multiple processes can be merged, thereby further improving the compression rate when compressing the trace logs generated by the multiple processes.

[0021] In another possible design, each log record in the first trace log also includes time data, where the time data includes the start time and call duration of the communication function. The method further includes compressing the time data in the first trace log based on the same call duration in the first trace log.

[0022] Through this possible design, compared to the typical method of recording the start and end times of function calls in log records, this application uses the time when the function call starts and the call duration (i.e., the function's runtime) to characterize the start and end times of function calls. Furthermore, because the runtimes of communication functions are generally similar or identical, the time data recorded by this application may contain a large number of repeated durations. In this case, when compressing the time data, the compression rate is high.

[0023] In another possible design, when the hardware resources occupied by the first process in the node are first hardware resources, the method further includes: obtaining a first dataset, the first dataset including performance data of the first hardware resource at multiple moments during the execution of the first process. The data within each cluster range in the first dataset is characterized using a preset value corresponding to each cluster range, thereby obtaining a second dataset that is a compression of the first dataset. The data difference within each cluster range is less than or equal to a preset error, and different preset values ​​correspond to different cluster ranges.

[0024] Through this possible design, for the performance data of hardware resources occupied during the process running: the first data set, when the data in the first data set is represented by the preset value corresponding to each cluster range, there will be a large number of identical characters in the first data set. In this case, when the first data set is compressed, the compression rate is high.

[0025] In another possible design, the above performance data includes at least one of the following: instructions per cycle (IPC), cache miss rate (CMR), cache hit rate (CHR), and branch misprediction rate (BMR).

[0026] In another possible design, when the first process is a process of a target application, the target application also includes a second process, the hardware resources occupied by the second process in the node are second hardware resources, the third data set includes performance data of the second hardware resources at multiple times during the execution of the second process, and the fourth data set is obtained by compressing the third data set using preset values ​​corresponding to each cluster range. The above method further includes: characterizing the data within each cluster range in the second data set and the fourth data set using preset values ​​corresponding to each cluster range to achieve compression of the second data set and the fourth data set.

[0027] Through this possible design, the performance data of the hardware resources occupied by each of the multiple processes during their execution can be further compressed, thereby further improving the compression rate when compressing the performance data of the hardware resources occupied by each of the multiple processes during their execution.

[0028] In another possible design, the first process and the second process are run in different nodes.

[0029] Through this possible design, the method of the present application is applicable to scenarios where multiple processes are running in a cluster.

[0030] In a second aspect, the present application provides a data compression device.

[0031] In one possible design, the data compression device is used to execute any one of the methods provided in the first aspect above. The present application can divide the data compression device into functional modules according to any one of the methods provided in the first aspect above. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. Exemplarily, the present application can divide the data compression device into an acquisition unit and a processing unit, etc. according to the function. The description of the possible technical solutions and beneficial effects executed by each of the divided functional modules can refer to the technical solutions provided by the first aspect or its corresponding possible design, and will not be repeated here.

[0032] In another possible design, the data compression device includes: a memory, a communication interface and one or more processors, which receive or send data through the communication interface, and the one or more processors are configured to read program instructions stored in the memory to execute any method provided by the first aspect and any possible design thereof.

[0033] In a third aspect, the present application provides a computer-readable storage medium comprising program instructions, which, when executed on a computer or processor, enables the computer or processor to execute any method provided by any possible implementation of the first aspect.

[0034] In a fourth aspect, the present application provides a computer program product, which, when run on a data compression device, enables any method provided by any possible implementation manner in the first aspect to be executed.

[0035] In a fifth aspect, the present application provides a chip system, comprising: a processor, the processor being used to call and run a computer program stored in a memory from the memory, and execute any one of the methods provided in the implementation manner in the first aspect.

[0036] It can be understood that any of the devices, computer storage media, computer program products or chip systems provided above can be applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods and will not be repeated here.

[0037] In this application, the name of the data compression device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalents. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] FIG1 is a schematic diagram of an application scenario of a data compression method provided in an embodiment of the present application;

[0039] FIG2 is a schematic diagram of a scenario in which a target application runs on a single node according to an embodiment of the present application;

[0040] FIG3 is a schematic diagram of a scenario in which a target application runs on multiple nodes according to an embodiment of the present application;

[0041] FIG4 is a schematic diagram of the hardware structure of a computing node provided in an embodiment of the present application;

[0042] FIG5 is a flow chart of a data compression method provided in an embodiment of the present application;

[0043] FIG6 is a flowchart of a process for constructing a first dictionary corresponding to a first trace log according to an embodiment of the present application;

[0044] FIG7 is a flow chart of another data compression method provided in an embodiment of the present application;

[0045] FIG8 is a block diagram of a process for compressing a first data set provided by an embodiment of the present application;

[0046] FIG9 is a schematic flow chart of another data compression method provided in an embodiment of the present application;

[0047] FIG10 is a schematic flow chart of another data compression method provided in an embodiment of the present application;

[0048] FIG11 is a schematic diagram of the compression result of data compression performed by the method provided in this application;

[0049] FIG12 is a diagram showing a comparison of the compression ratios of data compressed using the method provided by the present application and other compression methods;

[0050] FIG13 is a graph showing a comparison of compression times when data is compressed using the method provided by the present application and other compression methods;

[0051] FIG14 is a schematic structural diagram of a data compression device provided in an embodiment of the present application;

[0052] FIG15 is a schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to better understand the embodiments of the present application, some of the terms or technologies involved in the embodiments of the present application are explained below:

[0054] 1) Communication function

[0055] In the embodiments of the present application, functions that communicate with each other are referred to as communication functions. Alternatively, a communication function can be understood as a function that performs communication. A communication function can be a function that communicates within a process. Alternatively, a communication function can be a function that communicates between processes, without limitation.

[0056] When a communication function is a function used to communicate between processes, it effectively implements communication between the processes. For example, when processes 1 and 2 are running, process 1 calls function 1, and process 2 calls function 2. When functions 1 and 2 communicate, both functions 1 and 2 can be called communication functions, and the communication between functions 1 and 2 effectively implements communication between processes 1 and 2.

[0057] In some examples, the communication function may be a function that supports a message passing interface (MPI) protocol.

[0058] 2) Trace log

[0059] In the embodiment of the present application, the trace log is used to record the communication records during the process of running. The trace log generated by a single process may include one or more log records, and a log record may be used to record the function call record when the process calls a communication function.

[0060] It should be understood that when a function is called, function parameters need to be passed. Therefore, in some examples, a function call record in a log record may include a process ID (identity document, ID), function name, function parameters, start timestamp, and end timestamp.

[0061] The process identified by the process ID is the process that generates the current log record.

[0062] The function name is the function name of the communication function called by the process. Here, the communication function called by the process can be a function for communicating with other functions within the process, or a function for communicating with other processes outside the process, without limitation.

[0063] Function parameters are parameters of the communication function called by the process. Function parameters generally include multiple parameter items. A parameter item represents a parameter, and a parameter item includes the parameter name and parameter value of the parameter represented by the parameter item.

[0064] The start timestamp indicates the time when the process starts calling the communication function. The end timestamp indicates the time when the process finishes scheduling the communication function, or the time when the process finishes executing the currently called communication function.

[0065] For example, suppose that a process with process ID 0 (or process 0) calls a communication function called MPI_Isend to communicate with another function. Therefore, when process 0 calls the communication function MPI_Isend, the trace collection tool generates log record 0:

[0066] Among them, "Rank = 0" indicates process 0. "Function: MPI_Isend" indicates the communication function called by process 0, and the function name of this communication function is "MPI_Isend". "Paravalues: = ()" indicates the parameters of the communication function MPI_Isend, where each line in the brackets is a parameter item and represents a parameter type. A reference item includes the parameter name before the equal sign and the parameter value after the equal sign. "Starttime" is the time when process 0 starts calling the communication function MPI_Isend, and "Endtime" is the time when process 0 ends calling the communication function MPI_Isend.

[0067] In other examples, a function call record in a log record includes not only the process number, function name, function parameters, start timestamp, and end timestamp, but also records of including or calling other communication functions in the communication function called by the process that generates the current log record (i.e., the communication function indicated by the aforementioned function name).

[0068] 3) Other terms

[0069] In the embodiments of the present application, the terms "first" and "second" do not indicate a sequential relationship, but are used to distinguish different objects. The first, second, etc. mentioned in the following documents are also used to distinguish different messages, etc., and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.

[0070] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0071] It should also be understood that the term "at least one (at least one)" in the embodiments of the present application means one or more (one or more). The term "multiple (multiple)" in the embodiments of the present application means two or more (two or more).

[0072] Trace logs generated during process execution can be compressed using common compression technologies (such as zlib). However, using common compression technologies to compress trace logs has a low compression rate and takes a long time.

[0073] Based on this, an embodiment of the present application provides a data compression method. For the trace log generated during the running of a process, the method uses different processing methods to compress different data in the trace log. For example, for the function call record of calling a communication function in the trace log, the method realizes the compression of the call record in the trace log by constructing a dictionary and a grammar set corresponding to the function call record. For another example, for the time data of calling a communication function in the trace log, the method uses the time when the communication function is started to be called and the call duration as the time data of calling the communication function in the trace log, and compresses the time data of calling the communication function in the trace log according to the repeated call duration in the time data.

[0074] Therefore, by using different processing methods to compress different data in the trace log in a targeted manner, the compression rate of the trace log can be greatly improved and the compression time can be shortened.

[0075] The above process can be a process for running any application (or computing task). Taking the above process as an example of a process for running a target application, the embodiment of the present application does not specifically limit the type of target application and the functions implemented by the target application.

[0076] Optionally, the target application may be a simulation application, or a neural network model with classification capabilities, etc., but is not limited thereto. As an example, the target application may be an application that implements the conjugate gradient method. The conjugate gradient method is a commonly used iterative method for solving large linear equations.

[0077] Referring to Figure 1, Figure 1 shows a schematic diagram of an application scenario of the data compression method provided by an embodiment of the present application. As shown in Figure 1, during the process of a node running a target application, the process of the target application can generate a trace log. The node then compresses the trace log and outputs the compressed trace log. In this way, when it is necessary to perform performance analysis on the program of the target application, the analysis device can obtain the compressed trace log. Thus, the compressed trace log can save transmission resources between the node that generates the original data of the trace log and the analysis device, as well as save storage space in the analysis device for storing trace logs.

[0078] Among them, the method provided in the embodiment of the present application is used to implement the part of compressing the trace log in the scenario shown in Figure 1.

[0079] Optionally, the target application may be executed by one or more processes, or it can be understood that the target application may include one or more processes. It is understood that when the target application is executed in parallel by multiple processes, the processing efficiency of the target application can be improved.

[0080] Optionally, when the target application is executed through multiple processes, the multiple processes may be run in parallel in a single node, or in parallel in a cluster including multiple nodes, which is not limited.

[0081] The following example illustrates two target application execution scenarios. Assume the target application consists of three processes: Process 1, Process 2, and Process 3. Process 1 is the target application's main process, while Process 2 and Process 3 are its child processes. The target application's main process serves as the entry point for executing the target application, controlling and connecting to the child processes.

[0082] Referring to Figure 2, a schematic diagram illustrating a scenario in which a target application is running on a single node, according to an embodiment of the present application, is shown. As shown in Figure 2, node 20 includes processing core 21, processing core 22, and processing core 23. Thus, process 1 can run on processing core 21, process 2 can run on processing core 22, and process 3 can run on processing core 23. It should be understood that node 20 may also include more processing cores, without limitation.

[0083] Referring to Figure 3, Figure 3 shows a schematic diagram of a scenario in which a target application provided by an embodiment of the present application runs on multiple nodes. As shown in Figure 3, cluster 30 includes a management node 31, a work node 32, and a work node 33. Of course, cluster 30 can also include more work nodes (not shown in Figure 3). Among them, management node 31 is used to manage and control each work node in cluster 30. In this case, process 1 can run on management node 31, process 2 can run on work node 32, and process 3 can run on work node 33.

[0084] Optionally, the function of the management node in the cluster 30 may also be assumed by a worker node in the cluster 30. In this case, process 1 may run in a worker node having the function of the management node.

[0085] The present application also provides a data compression device for executing the data compression method provided in the present application. Optionally, the compression device can be any computing node with computing processing capabilities, or a functional module within the computing node. The computing node can access trace logs generated by the target application process during operation.

[0086] It should be understood that during the operation of the target application process, the generated trace log will be written to the storage space corresponding to the preset file directory. The storage space corresponding to the preset file directory can be the local storage space of the node running the target application, or the storage space of the storage system that the node running the target application can access, and there is no limitation on this. Optionally, when the storage space corresponding to the preset file directory is the local storage space of the node running the target application, the local storage space can be the local storage space of the node running the main process of the target application. Among them, the preset file directory corresponding to the trace log can also be called the default file directory of the trace log.

[0087] In one example, the computing node is a node running the target application. Optionally, when the target application is running in a cluster, the computing node may be a management node running the main process of the target application, which is not limited to this.

[0088] In another example, the computing node includes but is not limited to a general-purpose computer, a laptop, a tablet, or other computing devices. Alternatively, the computing node is a server.

[0089] Referring to Figure 4 , a hardware structure diagram of a computing node provided in an embodiment of the present application is shown. As shown in Figure 4 , computing node 40 includes a processor 401, a memory 402, a communication interface 403, and a bus 404. Processor 401, memory 402, and communication interface 403 are connected via bus 404.

[0090] Processor 401 is the control center of computing node 40 and can be a general-purpose central processing unit (CPU). Processor 401 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, graphics processing units (GPU), neural processing units (NPU), tensor processing units (TPU) or artificial intelligence (artificial intelligent) chips, data processing units (DPU), etc.

[0091] As an example, the processor 401 includes one or more CPUs, such as CPU 0 and CPU 1 shown in Figure 4. In addition, the present application does not limit the number of processor cores in each processor.

[0092] The memory 402 is used to store program instructions or data to be accessed by the application process. The processor 401 can implement the data compression method provided in the embodiment of the present application by executing the program instructions in the memory 402.

[0093] The memory 402 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronized dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). Non-volatile memory can be storage class memory (SCM), solid state drive (SSD), hard disk drive (HDD), etc. Storage class memory can be, for example, non-volatile memory (NVM), phase-change memory (PCM), persistent memory, etc.

[0094] In one possible implementation, memory 402 exists independently of processor 401. Memory 402 is connected to processor 401 via bus 404 and is used to store data, instructions, or program code. When processor 401 calls and executes the instructions or program code stored in memory 402, the data compression method provided in the embodiment of the present application can be implemented.

[0095] In another possible implementation, the memory 402 and the processor 401 are integrated together.

[0096] Communication interface 403 is used to connect computing node 40 to other devices (such as analysis devices that need to obtain trace logs) via a communication network. The communication network can be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. Communication interface 403 includes a receiving unit for receiving data and a sending unit for sending data.

[0097] Bus 404 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, a high-speed serial computer expansion bus (PCIe), a Compute Express Link (CXL), or an Extended Industry Standard Architecture (EISA) bus. This bus can be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, FIG4 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.

[0098] It should be noted that the structure shown in FIG4 does not constitute a limitation on the computing node 40. In addition to the components shown in FIG4, the computing node 40 includes more or fewer components than shown in FIG4, or combines certain components, or arranges the components differently.

[0099] The data compression method provided in the embodiments of the present application is described below with reference to the accompanying drawings.

[0100] In some embodiments, referring to FIG5 , FIG5 shows a flow chart of a data compression method provided by an embodiment of the present application. Optionally, the method can be executed by a computing node having the hardware structure shown in FIG4 . For ease of description, in the current embodiment, the target application includes a first process, and the computing node executing the method described in the embodiment of the present application is a node running the first process. The method includes the following steps:

[0101] S101: Obtain a first trace log generated during the execution of a first process.

[0102] The first trace log includes at least one log record, each of which includes a function call record when the first process calls a communication function. The function call record when the first process calls a communication function includes the function name and function parameters described above, as well as records of other communication functions included in or called by the communication function called by the first process. For detailed descriptions, please refer to the description of "trace logs" above. For descriptions of communication functions, please refer to the description of "communication functions" above, and will not be repeated here.

[0103] Optionally, the communication function called by the first process may be a function for communicating with other functions within the first process, or a function for communicating with other processes outside the first process, and this is not limited.

[0104] Each log record in the first trace log also includes time data. In an embodiment of the present application, the time data in the log record includes the start time of calling the communication function and the call duration. Here, the call duration can also be understood as the running time of the called communication function. For any log record in the first trace log, such as the first log record, assuming that the function call record in the first log record is a function call record of the first communication function called by the first process, the time data of the first log record includes the time when the first process starts calling the first communication function and the call duration. Among them, the start time of starting to call the first communication function + the call duration can be used to indicate the time when the first process ends / completes calling the first communication function.

[0105] As an example, assume that the first process starts calling communication function 0 at time t0 during its execution and ends calling communication function 0 at time t1. In this case, the computing node may generate log record 0 during the process of running the first process calling communication function 0, and the time data in log record 0 includes t0 and (t1-t0). Among them, t0 represents the time when the first process starts calling communication function 0, and (t1-t0) represents the duration of the first process calling communication function 0.

[0106] Optionally, assuming that the program of the target application is called the target program, the computing node can modify the LD_PRELOAD environment variable of the target program before running the target program through the first process to realize the dynamic library loading of the trace log collected during the running of the target program. Then, in the process of running the target program through the first process, the computing node can access the first trace log generated during the running of the first process through the PMPI interface. For example, the computing node can copy the first trace log from the storage space corresponding to the default file directory for storing the first trace log through the PMPI interface. For another example, the computing node can modify the default file directory of the storage space for storing the first trace log through the PMPI interface to a file directory of the storage space that can be accessed by the process executing the method of the embodiment of the present application, without limitation.

[0107] S102: Construct a first dictionary and a first grammar set according to the function call records in the first trace log to achieve compression of the function call records in the first trace log.

[0108] The first dictionary includes at least one symbol string, and the first grammar set includes at least one grammar tree. The number of symbol strings in the first dictionary and the number of grammar trees in the first grammar set are the same as the number of log records in the first trace log, and correspond one-to-one.

[0109] For any log record in the first trace log, such as the first log record, when a function call record in the first log record is referred to as a first function call record, the first symbol string corresponding to the first log record in the first dictionary is used to represent the first function call record, and the first grammar tree corresponding to the first log record in the first grammar set is used to represent the function call relationship in the first function call record. Therefore, the first symbol string and the first grammar tree also have a corresponding relationship.

[0110] The first dictionary also includes a first description information set, which includes at least one description information. The at least one description information includes description information for describing the semantics of each symbol string in the first dictionary.

[0111] The following describes in detail a process in which the computing node constructs the first dictionary and the first grammar set according to the function call records in the first trace log. The process includes steps S1021 - S1022 .

[0112] S1021. The computing node constructs a symbol string corresponding to each log record according to the function call record of each log record in the first trace log to obtain a first dictionary corresponding to the first trace log.

[0113] First, for any log record in the first trace log, such as the first log record, assuming that the function call record in the first log record is the first function call record, optionally, the computing node can use the function name in the first function call record and the parameter value in each parameter item to construct a first symbol string representing the first function call record. Optionally, the computing node can also use the number corresponding to the function name in the first function call record and the parameter value in each parameter item to construct the first symbol string representing the first function call record. In this case, the compressed data of the first trace log includes the correspondence between the function name and the number. Among them, the relevant description of the parameter items can refer to the above description and will not be repeated here.

[0114] As an example, taking the log record 0 mentioned above as an example, the computing node can construct the symbol string 0 representing the function call record of log record 0 based on the function call record of log record 0: "MPI_Isend;-1270915064;961;1275070475;4;1024;1140850688;160750800".

[0115] The symbol string 0 includes the function name "MPI_Isend" in the log record 0 function call record, and the parameter value of each parameter item in the log record 0 function call record.

[0116] As another example, taking the log record 0 described above as an example, the computing node can construct a symbol string 1 representing log record 0 based on the function call record of log record 0: "01; -1270915064; 961; 1275070475; 4; 1024; 1140850688; 160750800".

[0117] Where "01" is the number corresponding to the function name "MPI_Isend" in the log record 0 function call record.

[0118] In addition, when constructing the first symbolic string corresponding to the first log record based on the function call record in the first log record, the computing node also generates description information for describing the semantics of the first symbolic string based on the function call record in the first log record. The description information for describing the semantics of the first symbolic string is specifically a grammar that describes the parameter name of each parameter value in the first symbolic string. A parameter name can identify a parameter. The grammar that describes the parameter name of a parameter value can be called a description grammar.

[0119] As an example, taking the log record 0 described above as an example, when the computing node generates the above-mentioned symbol string 0 "MPI_Isend; -1270915064; 961; 1275070475; 4; 1024; 1140850688; 160750800" according to the function call record of log record 0, the computing node generates description information used to describe the semantics of the symbol string 0 according to the function call record of log record 0: the first parameter value is the value of the parameter "mpip_const_void_t buf", the second parameter value is the value of the parameter "int count", the third parameter value is the value of the parameter "MPI_Datatype datatype", the fourth parameter value is the value of the parameter "Int dest", the fifth parameter value is the value of the parameter "Int tag", the sixth parameter value is the value of the parameter "MPI_Comm comm", and the seventh parameter value is the value of the parameter "MPI_Request request". It can be seen that the description information used to describe the semantics of the symbol string 0 includes 7 description grammars.

[0120] In some possible implementations, when function call records in at least two log records in a first trace log have the same semantics, the symbolic string used to represent the function call records in the at least two log records in the first dictionary corresponds to a piece of description information in the first description information set. That is, in embodiments of the present application, the symbolic string used to represent the function call records in the at least two log records in the first dictionary is described using a piece of description information in the first description information set.

[0121] For example, if the function call record in the first log record of a first trace log is the first function call record, and the function call record in the second log record of the first trace log is the second function call record, the first function call record and the second function call record have the same semantics, meaning that the multiple parameters represented by all parameter items in the first function call record have a one-to-one correspondence with the multiple parameters represented by all parameter items in the second function call record. It should be understood that parameters with the same parameter name are the same type of parameter. Thus, the parameter items representing the same type of parameter in the first and second function call records have the same parameter name, but the parameter values ​​may be the same or different, without limitation. Therefore, when the function call records in multiple log records have the same semantics, the multiple symbol strings corresponding to the multiple log records are different, but they may share a single descriptive information. In this case, when the computing node compresses the function call records in the first trace log by constructing the first dictionary, it also needs to establish a correspondence between the multiple symbol strings that share a single descriptive information and the descriptive information. Based on this, further compression of the function call records in the first trace log can be achieved.

[0122] As an example, in combination with the above-mentioned log record 0, it is assumed that the function call record of log record 1 obtained by the computing node includes 7 parameter items representing the parameters "mpip_const_void_t buf", "int count", "MPI_Datatype datatype", "Int dest", "Int tag", "MPI_Comm comm", and "MPI_Request request". It can be seen that the 7 parameters represented by all the parameter items in the function call record of log record 1 are the same as the 7 parameters represented by all the parameter items in the function call record of log record 0. When the parameter values ​​in the parameter items representing the same parameter in log record 0 and log record 1 are different, the symbol string 0 representing the function call record in log record 0 and the symbol string 1 representing the function call record in log record 1 are different, but the description information describing the semantics of symbol string 0 and the description information describing the semantics of symbol string 1 are the same. Therefore, symbol string 0 and symbol string 1 share one piece of description information. Furthermore, in the process of compressing the first trace log by constructing the first dictionary, the computing node also establishes corresponding relationships between the common description information and symbol string 0, and between the common description information and symbol string 1.

[0123] In this way, by executing S1021 to construct a corresponding symbol string and description information for each log record of the first trace log, a first dictionary corresponding to the first trace log can be obtained.

[0124] In some examples, referring to FIG6 , FIG6 shows a flowchart of a process for constructing a first dictionary corresponding to a first trace log provided by an embodiment of the present application.

[0125] Assuming that the process executing the method described in the embodiment of the present application in the computing node is referred to as the compression process, as shown in FIG6 , the compression process first obtains the function call record of the first log record in the first trace log, and constructs the corresponding symbol string 1, then writes the symbol string 1 into the symbol string table, and then constructs description information 1 describing the semantics of the symbol string 1, writes the description information 1 into the first description information set, and establishes a correspondence between the symbol string 1 and the description information 1. The symbol string table is used to write the symbol string representing each log record function call record in the first trace log.

[0126] Next, the compression process obtains the function call record of the second log record in the first trace log, and constructs the corresponding symbol string 2, and then writes the symbol string 2 into the symbol string table to update the symbol string table, and then constructs description information 2 that describes the semantics of symbol string 2, and writes description information 2 into the first description information set to update the first description information set, and establishes the correspondence between symbol string 2 and description information 2.

[0127] Then, the compression process obtains the function call record of the third log record in the first trace log, and constructs the corresponding symbol string 3, and then writes the symbol string 3 into the symbol string table to update the symbol string table. Assuming that the semantics of the function call record in the third log record is the same as the semantics of the function call record in the first log record, a correspondence between the symbol string 3 and the description information 1 is established, and the first description information set remains unchanged.

[0128] Similarly, the compression process performs the process described in FIG. 6 on each log record in the first trace log, thereby obtaining a first dictionary corresponding to the first trace log.

[0129] S1022. The computing node constructs a grammar tree corresponding to each log record according to the function call record in each log record in the first trace log, thereby obtaining a first grammar set corresponding to the first trace log.

[0130] Specifically, for the first function call record in the first log record in the first trace log, the computing node may construct a grammar tree corresponding to the first log record, using the communication function indicated by the function name in the first function call record as the root, the communication function included or called in the first function call record as the child, and based on the number of times the communication function included or called in the first function call record was run. The grammar tree corresponding to the first log is used to represent the function call relationship in the first function call record.

[0131] Among them, the communication function indicated by the function name in the first function call record can be called the root function (that is, the communication function directly called by the first process). In this case, the "communication function included or called in the first function call record" refers to the communication function included in the root function or the communication function called by the root function. Here, the "communication function called by the root function" can be a function that communicates with other functions in the first process, or a function that communicates with processes other than the first process, and there is no limitation on this. It should be understood that the root function can call one or more functions that communicate with other functions or processes, and the communication function called by the root function can also call the communication function, and there is no limitation on this.

[0132] As an example, when the first process generates log record 1 in the process of calling communication function 1, and the function call record of log record 1 includes: a record that communication function 1 calls communication function 2 and communication function 2 is executed 3 times, a record that communication function 1 calls communication function 3 and communication function 3 is executed 1 time, a record that communication function 2 calls communication function 4 and communication function 4 is executed 10 times, a record that communication function 1 includes communication function 5 and communication function 5 is executed 2 times, a record that communication function 5 calls communication function 6 and communication function 6 is executed 2 times, and a record that communication function 7 in communication function 1 is called by other functions / processes and communication function 7 is executed 8 times when called.

[0133] In this case, the grammar tree 1 constructed by the computing node based on the function call record of log record 1 to represent the function call relationship in the function call record is "communication function 1->communication function 2^3, communication function 1->communication function 3^1, communication function 2->communication function 4^10, communication function 5^2, communication function 5->communication function 6^2, -communication function 7^8". Among them, the information on the left of "->" represents the parent function in the function call relationship, the information on the right of "->" represents the child function in the function call relationship, and "^value a" represents the number of executions is a. Therefore, "communication function 1->communication function 2^3" can mean that communication function 1 calls communication function 2 and executes communication function 2 3 times. "Communication function 5^2" means that communication function 5 is executed autonomously 2 times. "-communication function 7^8" means that communication function 7 is called, and communication function 7 is executed 8 times when called.

[0134] In some possible scenarios, during the process of a first process calling a first communication function, the first communication function does not include other communication functions, and the first communication function does not call other communication functions. In this case, for a first log record generated by a computing node during the process of the first process calling the first communication function, the grammar tree constructed by the computing node based on the function call record in the first log record only includes the root function node.

[0135] For example, if a first process calls communication function 2, and no other communication functions exist within communication function 2, and communication function 2 does not call any other communication functions, the compute node generates log record 2 during the first process's call to communication function 2. Grammar tree 2 constructed based on the function call record in log record 2 is "communication function 2^1." "Communication function 2^1" indicates that communication function 2 was executed autonomously once.

[0136] To improve the compression ratio, before running the first process, the embodiment of the present application can first number the communication functions included in the first process and establish a correspondence between these communication functions and the numbers representing these communication functions. In this way, when the embodiment of the present application constructs the grammar tree corresponding to the log record, each function node in the grammar tree is represented by the number of the communication function. In this case, the file after compressing the first trace log needs to include the correspondence between the communication function and the number representing the communication function.

[0137] In the above example, assume that in the pre-built correspondence between communication functions and numbers on the compute nodes, communication function 1 is numbered 1, communication function 2 is numbered 2, communication function 3 is numbered 3, communication function 4 is numbered 4, communication function 5 is numbered 5, communication function 6 is numbered 6, and communication function 7 is numbered 7. Then, the above grammar tree 1 can be "1->2^3, 1->3^1, 2->4^10, 5^2, 5->6^2, -7^8". The above grammar tree 2 can be "2^1".

[0138] It can be seen that the more communication functions included or called in the function call record of the first trace log, and the more times the communication functions included or called in the function call record are executed, the higher the compression rate of the communication functions included or called in the function call record of the first trace log by compressing the grammar tree.

[0139] In this way, by constructing a corresponding grammar tree for each log record in the first trace log in S1022, a first grammar set corresponding to the first trace log can be obtained.

[0140] It should be understood that the process by which the compute node constructs the first dictionary and the first grammar based on the function call records in the first trace log compresses the function call records in the first trace log. Therefore, during decompression, the function call records for each log record in the first trace log can be restored using the first dictionary and the first grammar.

[0141] It should also be understood that the present embodiment of the present application does not specifically limit the order in which S1021 and S1022 are executed. For example, S1021 may be executed first, followed by S1022. Alternatively, S1022 may be executed first, followed by S1021. Alternatively, S1021 and S1022 may be executed simultaneously. This is not limited to the preceding examples.

[0142] S103 (optional): compress the time data in the first trace log according to the same call duration in the first trace log.

[0143] In each log record generated by the first process during execution based on a communication function call, the time when the first process starts calling the communication function and the time when the communication function call ends are generally different. However, the runtime of a single communication function is mostly the same or similar. In other words, the call durations of the communication functions called by the first process are mostly the same or similar.

[0144] Thus, because the time data in the log records in the embodiment of the present application includes the time when the communication function is started and the duration of the call, the time data in the log records provided by the embodiment of the present application includes a large number of repeated or similar call durations. In other words, the time data in the log records provided by the embodiment of the present application includes a large number of repeated or similar character strings.

[0145] Therefore, the computing node can compress the time data in the first trace log according to the same or similar call durations in all log records of the first trace log, thereby achieving a high compression rate.

[0146] Optionally, the computing node may compress the time data in the first trace log using any lossy compression method according to the same or similar call durations in all log records of the first trace log, and this is not limited.

[0147] In this way, through S101-S103, the trace log generated during the operation of the first process can be compressed. Among them, the function call records in the trace log are compressed by constructing the first dictionary and the first grammar set, and the time data in the trace log is expressed by the time when the communication function is started and the call duration. Therefore, the time data in the trace log can not only express the time when the communication function is started and the time when the communication function is ended, but also generate a large number of repeated character strings (i.e., repeated call durations) in the time data of the trace log, and then when the time data of the trace log is compressed, the compression rate is very high. It can be seen that the method provided in the embodiment of the present application performs different compression processing on different data in the trace log, thereby greatly improving the compression rate of the trace log and shortening the compression time.

[0148] It can be seen that the compressed file obtained after compressing the trace log of the first process through S101-S103 includes the first dictionary, the first grammar tree, the correspondence between the communication functions and numbers of the first process, and compressed time data.

[0149] In other embodiments, when performing performance analysis on a target application program, in addition to analyzing the trace logs generated by the target application process during execution, the hardware performance data used to run the target application process during execution is also analyzed. In this case, to reduce the resources required to store or transmit this hardware performance data, this hardware performance data can be compressed using the method described below in the embodiments of this application.

[0150] Referring to Figure 7, Figure 7 shows a flow chart of another data compression method provided by an embodiment of the present application. Optionally, the method can be executed by a computing node having the hardware structure shown in Figure 4. For ease of description, in the current embodiment, the target application includes a first process, the computing node executing the method described in the embodiment of the present application is a node running the first process, and the hardware resources occupied by the first process in the first process are first hardware resources. The method includes the following steps:

[0151] S201: Acquire a first data set, where the first data set includes performance data of a first hardware resource at multiple moments during the execution of a first process.

[0152] The first data set includes multiple sets of performance data (or hardware performance data) of the first hardware resource, each set of performance data including but not limited to one or more of the following: instructions per cycle (IPC), cache miss rate (CMR), cache hit rate (CHR), and branch misprediction rate (BMR).

[0153] In one possible implementation, the computing node may read performance data of the first hardware resource from a performance monitoring unit (PMU) of the computing node at a preset frequency while the first process is running. The performance data read by the computing node from the PMU each time is the aforementioned set of performance data.

[0154] In another possible implementation, the computing node may read the performance data of the first hardware resource from the PMU of the computing node at the time each log record is generated during the execution of the first process. The performance data read from the PMU by the computing node at the time each log record is generated constitutes the aforementioned set of performance data.

[0155] S202 : Characterize the data in each cluster range in the first data set by using a preset value corresponding to each cluster range, so as to obtain a second data set obtained by compressing the first data set.

[0156] Due to inherent errors in the PMU, similar data within the same performance data read by a compute node from the PMU can be considered identical. For example, among multiple CMRs read by a compute node, 80.5%, 81%, 79%, and 79.5% are all considered identical.

[0157] Therefore, in a first possible implementation, the computing node pre-sets multiple preset ranges for each type of performance data, and each preset range corresponds to a preset value. For any preset range, the preset value corresponding to the preset range can be a number or ID set by the computing node for the preset range, or the median of the preset range. This embodiment of the present application does not specifically limit the size of each preset range; for example, the size of each preset range can be determined based on the inherent error of the PMU.

[0158] Thus, when the computing node sets multiple preset ranges for any type of performance data in the first data set (e.g., the first type of performance data), data in the first type of performance data that is within a first preset range among the multiple preset ranges can be represented by a preset value corresponding to the first preset range. The first preset range is any one of the aforementioned multiple preset ranges.

[0159] As an example, for a CMR, the computing node sets preset range 1 [0, 70%), preset range 2 [70%, 75%), preset range 3 [75%, 80%), preset range 4 [80%, 85%), preset range 5 [85%, 90%), and preset range 6 [90%, 100%). Furthermore, the preset value corresponding to preset range 1 is 11, the preset value corresponding to preset range 2 is 12, the preset value corresponding to preset range 3 is 13, the preset value corresponding to preset range 4 is 14, the preset value corresponding to preset range 5 is 15, and the preset value corresponding to preset range 6 is 16. Then, when the computing node determines that CMR 1 in the first data set is within preset range 2, the computing node represents CMR 1 by 12.

[0160] In this case, the first data set representing the performance data using the preset values ​​will include a large amount of duplicate data. Then, the computing node can compress the first data set including a large amount of duplicate data after the performance data are all represented using the preset values ​​to obtain the second data set.

[0161] Optionally, the computing node may compress the first data set including a large amount of duplicate data according to an lzma (Lempel-Ziv-Markov chain-Algorithm) compression algorithm to obtain the second data set.

[0162] In a second possible implementation, the computing node can cluster each type of performance data in the first data set using a preset error. The difference between any two performance data clustered together must be less than the preset error. Thus, the performance data clustered together can be referred to as performance data within a cluster. This embodiment of the present application does not specifically limit the size of the preset error; for example, the preset error can be set based on the inherent error of the PMU.

[0163] Next, the computing node sets a preset value for each cluster range. Here, the description of how the computing node sets a preset value for each cluster range can refer to the above description of setting a preset value for each preset range, which will not be repeated here.

[0164] Then, the computing node can characterize the performance data belonging to each cluster range in the first data set using the preset value corresponding to each cluster range. In this way, after characterizing the performance data belonging to each cluster range in the first data set using the preset value corresponding to each cluster range, the first data set will include a large amount of repeated data.

[0165] Furthermore, the computing node compresses the first data set including a large amount of duplicate data, for example, by using an lzma compression algorithm, thereby obtaining a second data set.

[0166] In the specific implementation of the second possible design, refer to FIG8 , which shows a block diagram of a process for compressing the first data set. The process can be implemented by the following steps:

[0167] S1. Cluster similar data in the first data set based on a preset error.

[0168] S2. Characterize the performance data within the cluster range in the first data set using a preset value corresponding to the cluster range.

[0169] S3. Compress the first data set represented by the preset value to obtain a second data set.

[0170] Thus, through the method described in S201-S202, the computing node achieves compression of the performance data of the first hardware resource during the execution of the first process. Based on the inherent error of the PMU that monitors the hardware resource performance data, similar data in the first dataset is characterized by preset values. This can generate a large amount of identical data in the first dataset, thereby improving the compression rate and shortening the compression time when compressing the first dataset.

[0171] In some other embodiments, the target application includes multiple processes, and the trace logs generated during the execution of each process are compressed using the method described in S101-S103. To improve the compression rate of the trace logs generated by the multiple processes of the target application, the trace logs generated by each process of the target application can be compressed using the method described in S101-S103, and then further compressed based on the differences between the trace logs of the multiple processes.

[0172] Referring to Figure 9, Figure 9 shows a flow chart of another data compression method provided by an embodiment of the present application. Optionally, the method can be executed by a computing node having the hardware structure shown in Figure 4. For the convenience of description, in the current embodiment, the target application includes a first process and a second process, and a first trace log is generated during the operation of the first process, and a second trace log is generated during the operation of the second process. The first process and the second process can run in the same node or in different nodes, and there is no limitation on this. The method includes the following steps:

[0173] S301: Obtain a first dictionary and a first grammar set obtained by compressing function call records in a first trace log, and obtain a second dictionary and a second grammar set obtained by compressing function call records in a second trace log.

[0174] Among them, the process in which the computing node obtains the first trace log generated during the running of the first process, and compresses the function call records of the first trace log to obtain the first dictionary and the first grammar set, as well as the detailed description of the first dictionary and the first grammar set, can all be referred to the description of S101-S102 above and will not be repeated here.

[0175] Similarly, the computing node obtains the second trace log generated during the running of the second process, and compresses the function call records of the second trace log to obtain a detailed description of the second dictionary and the second grammar set. You can refer to the computing node obtaining the first trace log generated during the running of the first process, and compressing the function call records of the first trace log to obtain a description of the first dictionary and the first grammar set, which will not be repeated here.

[0176] Among them, the second dictionary includes at least one symbol string, and the second grammar set includes at least one grammar tree. The number of symbol strings in the second dictionary and the number of grammar trees in the second grammar set are the same as the number of log records in the second trace log, and correspond one to one. For any log record in the second trace log, such as the second log record, when the function call record in the second log record is referred to as the second function call record, the second symbol string corresponding to the second log record in the second dictionary is used to represent the second function call record, and the second grammar tree corresponding to the second log record in the second grammar set is used to represent the function call relationship in the second function call record. It can be seen that the second symbol string and the second grammar tree also have a corresponding relationship.

[0177] The second dictionary also includes a second description information set, which includes at least one description information. The at least one description information includes description information for describing the semantics of each symbol string in the second dictionary.

[0178] It should be noted that in a scenario where the target application includes a first process and a second process, when the compute node constructs the grammar tree in the first grammar set and the grammar tree in the second grammar set, the communication function number used is unique within the domain that includes the first and second processes. This allows the grammar tree constructed by the compute node to clearly record the function call relationship between the first and second processes.

[0179] Therefore, when the target application includes a first process and a second process, the computing node first numbers the communication functions included in the first process and the second process before running the two processes, and establishes a correspondence between these communication functions and the numbers representing these communication functions. Specifically, when the first process and the second process call the same communication function, but because the communication function is called by different processes, the communication function is assigned different numbers in the first process and the second process to distinguish the processes that call and run the communication function.

[0180] Optionally, the computing node may number the communication functions included in the first process and the second process, respectively. For example, the computing node may use the values ​​in the first number segment to number the communication functions included in the first process, and use the values ​​in the second number segment to number the communication functions included in the second process. In addition, the computing node also establishes a correspondence between the communication functions included in the first process and the corresponding numbers, and establishes a correspondence between the communication functions included in the second process and the corresponding numbers. The first number segment and the second number segment are different data segments. For example, the first number segment is 1 to 100, and the second number segment is 101 to 200. This is not limited to this.

[0181] S302: Determine whether the number of different description information in the first description information set in the first dictionary and the second description information set in the second dictionary exceeds a threshold.

[0182] The number of different description information in the first description information set and the second description information set represents the number of symbol strings with different semantics in the first dictionary and the second dictionary.

[0183] When the number of different description information in the first description information set and the second description information set is large, for example, exceeding a preset threshold, it indicates that the number of symbol strings with different semantics in the first dictionary and the second dictionary is large. In this case, the computing node can execute S305 to improve the compression rate of the trace logs generated by the multiple processes.

[0184] When the number of different description information in the first description information set and the second description information set is small, for example, less than a preset threshold, it indicates that the number of symbol strings with different semantics in the first dictionary and the second dictionary is small. In this case, the computing node can execute S304 to shorten the compression time of the trace logs generated by multiple processes.

[0185] The embodiments of the present application do not impose any specific restrictions on the specific values ​​of the above thresholds.

[0186] S303: Compress the first description information set and the second description information set according to text similarities of different description information in the first description information set and the second description information set to obtain a third description information set.

[0187] Specifically, the computing node compresses the different description information using a longest common subsequence (LCS) algorithm based on text similarity between different description information in the first description information set and the second description information set to obtain one or more compressed description information. A compressed description information is obtained by compressing at least two different description information from the first dictionary and the second dictionary.

[0188] It should be understood that when the LCS algorithm is used to compress different description information, it can be understood as deleting repeated description grammars in different description information. Here, the description of the description grammar can be referred to above and will not be repeated here.

[0189] For example, if description information 1, describing the semantics of symbol string 1 in the first dictionary, is: the first parameter value is the value of parameter a, the second parameter value is the value of parameter b, and the third parameter value is the value of parameter c. Description information 2, describing the semantics of symbol string 2 in the second dictionary, is: the first parameter value is the value of parameter d, the second parameter value is the value of parameter b, the third parameter value is the value of parameter c, the fourth parameter value is the value of parameter e, and the fifth parameter value is the value of parameter f. Clearly, description information 1 and description information 2 are different, but they contain the same grammar: the second parameter value is the value of parameter b, and the third parameter value is the value of parameter c. Therefore, based on the LCS algorithm, the compute node can compress description information 1 and description information 2 to obtain compressed description information: the first parameter value is the value of parameter a, the second parameter value is the value of parameter b, the third parameter value is the value of parameter c, the first parameter value is the value of parameter d, the fourth parameter value is the value of parameter e, and the fifth parameter value is the value of parameter f. At this time, the compressed description information also includes indication information for indicating that the first three description grammars in the compressed description information are semantics of description symbol string 1, and the last five description grammars are semantics of description symbol string 2.

[0190] In addition, for the same description information in the first description information set and the second description information set, the computing node deletes repeated description information in the same description information to achieve de-redundancy of the description information.

[0191] As an example, when the first description information set includes description information 1 for describing symbol string 1 in the first dictionary, and the second description information set includes description information 2 for describing symbol string 2 in the second dictionary, assuming that description information 1 and description information 2 are the same, the computing node deletes description information 1 or description information 2 during the compression process of the first trace log and the second trace log to achieve redundancy removal in the same description information 1 and description information 2.

[0192] Thus, the one or more compressed description information obtained based on the different description information in the first description information set and the second description information set, as well as the description information remaining after redundancy removal in the same description information, can constitute a third description information set. The third description information set includes description information used to describe the semantics of each symbol string in the first dictionary and the second dictionary, and does not contain duplicate description information or description grammar.

[0193] Furthermore, for the description information remaining after deduplication of the same description information, the computing node also establishes a correspondence between the description information and the corresponding symbolic string in the first trace log, and also establishes a correspondence between the description information and the corresponding symbolic string in the second trace log. In this way, when decompressing the first trace log and the second trace log, the computing node can restore the corresponding symbolic string in the first trace log and the corresponding symbolic string in the second trace log based on the description information remaining after deduplication.

[0194] For example, if the first description information set includes description information 1 for describing symbol string 1 in the first dictionary, and the second description information set includes description information 2 for describing symbol string 2 in the second dictionary, and description information 1 and description information 2 are identical, and the computing node deletes description information 1 to eliminate redundancy, the computing node also establishes a correspondence between description information 2 that remains after redundancy and symbol string 1 in the first dictionary, and a correspondence between description information 2 and symbol string 2 in the second dictionary.

[0195] S304: Merge the first description information set and the second description information set to obtain a third description information set.

[0196] Specifically, for the same description information in the first description information set and the second description information set, the computing node performs redundancy removal. Detailed descriptions can be found in the relevant description in S303 and will not be repeated here.

[0197] For a small amount of different description information between the first description information set and the second description information set, the computing node directly determines this part of the description information and the description information remaining after de-redundancy processing as the third description information set, and establishes a correspondence between these description information and the corresponding symbol strings. It can be seen that the third description information set includes description information used to describe the semantics of each symbol string in the first dictionary and the second dictionary.

[0198] By obtaining the third description information in this way, the time for compressing the function call records in the first trace log and the function call records in the second trace log can be saved.

[0199] In this way, through S301 to S304, the computing node further compresses the first description information set and the second description information set in different ways by adjusting the number of different description information in the first description information set and the second description information set, thereby achieving further compression of the function call records in the first trace log and the function call records in the second trace log, thereby improving the compression rate of the first trace log and the second trace log.

[0200] Optionally, after S301, the method may further include:

[0201] S305: Merge the first grammar set and the second grammar set according to the communication of functions between the first process and the second process.

[0202] When a communication function call exists between the first process and the second process, the grammar tree in the first grammar set and the grammar tree in the second grammar set may have function nodes with the same semantics. The communication function call between processes can realize communication between processes.

[0203] As an example, assume that the communication functions of the first process are numbered from 0 to 100, and the communication functions of the second process are numbered from 101 to 200. Based on the example shown above, grammar tree 1 in the first grammar set is "1->2^3, 1->3^1, 2->4^10, 5^2, 5->6^2, -7^8". Here, "-7^8" indicates that the communication function numbered 7 (i.e., the communication function 7 described above) was called and executed 8 times. When grammar tree 2 in the second grammar set is "101->7^8, 105^5", "101->7^8" indicates that the communication function numbered 101 called the communication function 7 and executed it 8 times. "105^5" indicates that the communication function numbered 105 was executed autonomously 5 times. It can be seen that the function node "-7^8" in grammar tree 1 and the function node "101->7^8" in grammar tree 2 have the same semantics: communication function 7 is called and executed 8 times.

[0204] Furthermore, the computing node can merge the grammar trees in the first and second grammars that include function nodes with the same semantics, thereby merging the first and second grammars. This eliminates redundancy in the function nodes with the same semantics in the first and second grammars. Furthermore, the computing node establishes a correspondence between different function nodes and multiple symbol strings in the merged grammar tree. Here, the multiple symbol strings are the symbol strings corresponding to the multiple grammar trees before the merging.

[0205] In combination with the above example, the computing node can merge and fuse grammar tree 1 "1->2^3, 1->3^1, 2->4^10, 5^2, 5->6^2, -7^8" in the first grammar set and grammar tree 2 "101->7^8, 105^5" in the second grammar set to obtain a fused grammar tree 3 "1->2^3, 1->3^1, 2->4^10, 5^2, 5->6^2, 101->7^8, 105^5". Moreover, when grammar tree 1 corresponds to symbol string 1 in the first dictionary and grammar tree 2 corresponds to symbol string 2 in the second field, the computing node also establishes a correspondence between the first 6 function nodes in grammar tree 3 and symbol string 1, and establishes a correspondence between the last two function nodes and symbol string 2.

[0206] In this way, through S301 and S305, the first grammar set and the second grammar set can be de-redundant to achieve compression of the first grammar set and the second grammar set, thereby further improving the compression rate of the function call records in the first trace log and the function call records in the second trace log.

[0207] Furthermore, in a scenario where the target application includes a first process and a second process, the time data of a first trace log generated during the execution of the first process is referred to as first time data, and the time data of a second trace log generated during the execution of the second process is referred to as second time data. For a detailed description of the second time data, refer to the description of the time data of the first trace log above and will not be repeated here.

[0208] At S103, the computing node has already compressed the first time data. The computing node can refer to S103 and compress the second time data. Furthermore, the computing node can further compress the compressed first time data and the compressed second time data to improve the compression ratio of the target application's trace log. For example, the computing node can use a general compression algorithm to further compress the compressed first time data and the compressed second time data, which will not be further described.

[0209] Of course, the computing node may also first obtain the first time data and the second time data recorded in the format described in this application, and then compress the obtained first time data and the second time data simultaneously, and there is no limitation to this.

[0210] In some other possible embodiments, when the target application includes multiple processes, the embodiments of the present application may further compress the hardware performance data obtained during the operation of each process to improve the compression ratio.

[0211] Referring to Figure 10, Figure 10 shows a flow chart of another data compression method provided by an embodiment of the present application. Optionally, the method can be executed by a computing node having the hardware structure shown in Figure 4. For the convenience of description, in the current embodiment, the target application includes a first process and a second process, and the hardware resources occupied by the first process are the first hardware resources, and the hardware resources occupied by the second process are the second hardware resources. The first process and the second process can run in the same node or in different nodes, and there is no limitation on this. The method includes the following steps:

[0212] S401: Acquire a second data set and a fourth data set.

[0213] The second data set is obtained by compressing the first data set obtained during the running of the first process. The specific process can refer to S201-S202 above. The detailed description of the first data set can refer to the relevant description in S201 and will not be repeated here.

[0214] The fourth data set is obtained by compressing the third data set obtained during the execution of the second process. The third data set includes multiple sets of performance data of the second hardware resource during the execution of the second process. Each set of performance data includes, but is not limited to, one or more of the following: IPC, CMR, CHR, and BMR. The process by which the computing node compresses the third data set to obtain the fourth data set can be referred to the description of the computing node compressing the first data set to obtain the second data set in S201-S202 above, and is not further described here.

[0215] S402 : Characterize the data in each cluster range in the second data set and the fourth data set by using a preset value corresponding to each cluster range, so as to achieve compression of the second data set and the fourth data set.

[0216] In one possible design, when the second dataset and the fourth dataset are obtained according to the first possible implementation in S202, the second dataset and the fourth dataset may include the same preset value. Therefore, the computing node can directly further compress the second dataset and the fourth dataset using a common compression method (e.g., LZMA).

[0217] In another possible design, when the second and fourth data sets are obtained according to the second possible implementation method in S202, the computing node may cluster each type of performance data in the second and fourth data sets based on the aforementioned preset error. The difference between any two performance data clustered together is less than the preset error. The computing node then sets a preset value for each cluster range and uses the preset value corresponding to each cluster range to represent the performance data in the second and fourth data sets belonging to each cluster range.

[0218] Then, the computing node compresses the second data set and the fourth data set represented by the preset value, for example, by using an lzma compression algorithm to compress them, thereby obtaining a compressed data set.

[0219] In this way, through S401-S402, further compression of hardware performance data obtained during the operation of multiple processes is achieved, thereby improving the data compression rate.

[0220] Of course, in a scenario where the target application includes multiple processes, the computing node can execute S202 described above on the first data set and the third data set after obtaining the first data set corresponding to the first process and the third data set corresponding to the second process, thereby achieving compression of the hardware performance data obtained during the operation of multiple processes.

[0221] The following experimental data is used to illustrate the beneficial effects of the method described in the embodiments of the present application.

[0222] In one example, referring to FIG11 , FIG11 shows a schematic diagram of a compression result of data compression performed by the method described in an embodiment of the present application.

[0223] As shown in Figure 11, the compression result includes an MPI communication function dictionary, and the MPI communication function dictionary includes dictionaries corresponding to each process in the target application (refer to the first dictionary and the second dictionary described above, etc.). The context-free grammar is a grammar set obtained by merging and compressing the grammar sets corresponding to the trace logs generated by each process of the target application (refer to S305). The performance counter cluster center ID and data dictionary include the preset values ​​described above, and the performance data within the preset range / cluster range corresponding to each preset value. For example, for "0:[136,31,264]", "0" represents the preset value, and "[136,31,264]" represents 3 performance data within the preset range / cluster range corresponding to the preset value "0".

[0224] In another example, as shown in Table 1, Table 1 shows relevant information for nine programs that conform to the MPI protocol. Among them, Conjugate Gradient (CG) and Multi-Grid (MG) are computational kernels in two Network Attached Storage (NAS) Parallel Benchmark (NPB), and the Block Tri-diagonal Solver (BT), Scalar Penta-diagonal Solver (SP), and Lower-Upper Gauss-Seidel Solver (LU) are three pseudo-applications in NPB. Sweep3d is a simulation program that describes neutron transfer problems in three-dimensional space. Sedov, Stirturb, and Sod are three classic problems in FLASH, a software package for solving fluid problems.

[0225] The problem size in NPB3.3.1 is set to D for the input and output data, the size of the three problems in the FLASH simulation is set to 64*64*64, and the input size in Sweep3d is 1000*1000*1000. Table 1 shows the names of the various test programs, along with the number of concurrent processes, events, trace size, and unique grammars.

[0226] Table 1

[0227] Furthermore, for the trace logs generated during the running of each test program shown in Table 1 and the performance data of the hardware resources occupied by the program process (hereinafter referred to as the data corresponding to Table 1), Figure 12 shows the compression rate comparison results when data is compressed by the method described in the embodiment of the present application and other compression methods. Among them, other compression methods include the Scalatrace method, the Dwarfcode method, the LCR method and the general zlib method. The Scalatrace method, the Dwarfcode method and the LCR method are compression methods studied in cutting-edge papers and will not be described in detail here.

[0228] As shown in Figure 12, the horizontal axis of the bar chart represents different data compression methods, and the vertical axis represents the data size obtained after compressing the data corresponding to Table 1. It can be seen that when the method described in the embodiment of the present application compresses the data corresponding to Table 1, the compression ratio is significantly better than that of zlib. Furthermore, compared with the Scalatrace method, the Dwarfcode method, and the LCR method, the method provided in the embodiment of the present application also has advantages.

[0229] For the data corresponding to the table, Figure 13 shows the compression time comparison results when the data is compressed using the method described in the embodiment of the present application and other compression methods, including the Scalatrace method, the Dwarfcode method, and the LCR method.

[0230] As shown in Figure 13, the horizontal axis of the bar chart represents different data compression methods, and the vertical axis represents the compression time consumed when compressing the data corresponding to Table 1. It can be seen that compared with the Scalatrace method, the Dwarfcode method, and the LCR method, the compression time consumed when compressing the data corresponding to Table 1 using the method described in the embodiment of the present application is significantly superior.

[0231] Combined with the compression rate comparison results shown in FIG12 and the compression time comparison results shown in FIG13 , the method described in the embodiment of the present application is superior to other current compression methods.

[0232] In another example, taking the execution of BT, LU, and SP of the NPB program under 512 or 529 concurrent processes as an example, the original size of the trace log generated by a single execution, the size of the zlib file, and the size of the file compressed by the method described in the embodiment of the present application are compared as shown in Table 2:

[0233] Table 2

[0234] It can be seen that the compression rate of the method described in the embodiment of the present application is significantly higher than the compression result of the zlib method.

[0235] Furthermore, for example, a supercomputer system with approximately 30,000 CPU cores generates approximately 100,000 trace logs per month, generating approximately 2,400 TB of storage overhead per year. Using the method described in this embodiment to compress trace logs can reduce storage and bandwidth overhead by over 99% compared to zlib compression.

[0236] The above mainly introduces the solution provided in the embodiment of the present application from the perspective of method.

[0237] To achieve the above functions, as shown in Figure 14, a schematic diagram of the structure of a data compression device 140 provided in an embodiment of the present application is shown. Data compression device 140 can be used to perform the above-mentioned data compression method, for example, the data compression method shown in Figures 5, 7, 9, or 10. Data compression device 140 can include an acquisition unit 1401 and a processing unit 1402.

[0238] The acquisition unit 1401 is used to obtain the first trace log generated during the operation of the first process, the first trace log includes at least one log record, and each log record in the first trace log includes a function call record when the first process calls a communication function, wherein the communication function is a function for communication. The processing unit 1402 is used to construct a first dictionary and a first grammar set based on the function call records in the first trace log to achieve compression of the function call records in the first trace log. The first dictionary includes at least one symbol string, and the first grammar set includes at least one grammar tree. For the first function call record included in any log record in the first trace log, the first symbol string in the first dictionary is used to represent the first function call record, and the first grammar tree in the first grammar set is used to represent the function call relationship in the first function call record.

[0239] As an example, in conjunction with FIG5 , the acquiring unit 1401 may be used to execute S101 , and the processing unit 1402 may be used to execute S102 .

[0240] Optionally, the above communication function includes an MPI function.

[0241] Optionally, the first dictionary further includes a first description information set, the first description information set including at least one description information item, the at least one description information item including description information for describing the semantics of each symbolic string in the first dictionary. When function call records in at least two log records in the first trace log have the same semantic structure, the symbolic string in the first dictionary used to represent the function call records in the at least two log records corresponds to a description information item in the first description information set.

[0242] Optionally, when the first process is a process of a target application, and the target application also includes a second process, and function call records in a second trace log generated during the execution of the second process are compressed to obtain a second dictionary including a second description information set, processing unit 1402 is further configured to compress the first description information set and the second description information set based on textual similarity between the different description information in the first description information set and the second description information set when it is determined that the number of different description information in the first description information set and the second description information set exceeds a threshold.

[0243] As an example, in conjunction with FIG9 , the processing unit 1402 may be configured to execute S303 .

[0244] Optionally, the processing unit 1402 is further configured to merge the first description information set and the second description information set when it is determined that the amount of different description information in the first description information set and the second description information set is less than the threshold.

[0245] As an example, in conjunction with FIG9 , the processing unit 1402 may be configured to execute S304 .

[0246] Optionally, when the first process is a process of a target application, the target application also includes a second process, and a second grammar set is obtained after compressing function call records in a second trace log generated during the execution of the second process. Processing unit 1402 is further configured to merge the first grammar set and the second grammar set based on function communication between the first process and the second process.

[0247] As an example, in conjunction with FIG9 , the processing unit 1402 may be configured to execute S305 .

[0248] Optionally, each log record in the first trace log further includes time data, the time data including the start time of calling the communication function and the call duration. The processing unit 1402 is further configured to compress the time data in the first trace log based on the same call duration in the first trace log.

[0249] As an example, in conjunction with FIG5 , the processing unit 1402 may be configured to execute S103 .

[0250] Optionally, when the hardware resource occupied by the first process in the node is the first hardware resource, acquisition unit 1401 is further configured to acquire a first dataset, where the first dataset includes performance data of the first hardware resource at multiple moments during the execution of the first process. Processing unit 1402 is further configured to characterize the data within each cluster range in the first dataset using a preset value corresponding to each cluster range, thereby obtaining a second dataset that is a compression of the first dataset.

[0251] As an example, in conjunction with FIG7 , the acquiring unit 1401 may be used to execute S201 , and the processing unit 1402 may be used to execute S202 .

[0252] Optionally, the above performance data includes at least one of the following: IPC, CMR, CHR and BMR.

[0253] Optionally, when the first process is a process of a target application, the target application also includes a second process, the hardware resources occupied by the second process in the node are second hardware resources, the third data set includes performance data of the second hardware resources at multiple times during the execution of the second process, and the fourth data set is obtained by compressing the third data set using a preset value corresponding to each cluster range. Processing unit 1402 is further configured to characterize data within each cluster range in the second data set and the fourth data set using the preset value corresponding to each cluster range, thereby compressing the second data set and the fourth data set.

[0254] As an example, in conjunction with FIG10 , the processing unit 1402 may be configured to execute S402 .

[0255] Optionally, the first process and the second process run in different nodes.

[0256] For the detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation and description of the beneficial effects of any of the above data compression devices 140 can refer to the above corresponding method embodiments, which will not be repeated here.

[0257] As an example, in combination with Figure 4, the functions implemented by the acquisition unit 1401 in the data compression device 140 can be implemented through the communication interface 403 shown in Figure 4, and the functions implemented by the processing unit 1402 can be implemented by the processor 401 in Figure 4 executing the program code in the memory 402 in Figure 4.

[0258] It should be readily apparent to those skilled in the art that, in combination with the units and algorithmic steps of the various examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0259] It should be noted that the module division shown in FIG14 is schematic and represents only one logical functional division. In actual implementation, other divisions may be employed. For example, two or more functions may be integrated into a single processing module. Such integrated modules may be implemented in either hardware or software functional modules.

[0260] An embodiment of the present application also provides a chip system 150, as shown in Figure 15, the chip system 150 includes at least one processor and at least one interface circuit. As an example, when the chip system 150 includes a processor and an interface circuit, the one processor may be the processor 151 shown in the solid box in Figure 15 (or the processor 151 shown in the dotted box), and the one interface circuit may be the interface circuit 152 shown in the solid box in Figure 15 (or the interface circuit 152 shown in the dotted box). When the chip system 150 includes two processors and two interface circuits, the two processors include the processor 151 shown in the solid box in Figure 15 and the processor 151 shown in the dotted box, and the two interface circuits include the interface circuit 152 shown in the solid box in Figure 15 and the interface circuit 152 shown in the dotted box. This is not limited.

[0261] The processor 151 and the interface circuit 152 can be interconnected via lines. For example, the interface circuit 152 can be used to receive signals (such as obtaining trace logs, etc.). For another example, the interface circuit 152 can be used to send signals to other devices (such as the processor 151). Exemplarily, the interface circuit 152 can read instructions stored in the memory and send the instructions to the processor 151. When the instruction is executed by the processor 151, the data compression device can perform the various steps in the above embodiments. Of course, the chip system 150 can also include other discrete devices, which is not specifically limited in the embodiments of the present application.

[0262] The embodiments of the present application also provide a computer program product and a computer-readable storage medium for storing the computer program product. The computer program product may include one or more program instructions that, when executed by one or more processors, may provide the functions or partial functions described above with respect to Figures 5, 7, 9, or 10. Thus, for example, one or more features of S101 to S103 in Figure 5 may be performed by one or more instructions in the computer program product.

[0263] In some examples, a data compression device, such as that described for executing FIG. 5 , FIG. 7 , FIG. 9 , or FIG. 10 , may be configured to provide various operations, functions, or actions in response to one or more program instructions stored in a computer-readable storage medium.

[0264] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the instructions are executed on a computer and executed by the computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available media can be magnetic media (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid state drive (SSD)).

[0265] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A data compression method, characterized in that: include: Obtaining a first trace log generated during the running of a first process; the first trace log includes at least one log record, each log record in the first trace log includes a function call record when the first process calls a communication function, and the communication function is a function for performing communication; According to the function call records in the first trace log, a first dictionary and a first grammar set are constructed to achieve compression of the function call records in the first trace log; wherein the first dictionary includes at least one symbol string, and the first grammar set includes at least one grammar tree; for the first function call record included in any log record in the first trace log, the first symbol string in the first dictionary is used to represent the first function call record, and the first grammar tree in the first grammar set is used to represent the function call relationship in the first function call record.

2. The method according to claim 1, characterized in that: The communication function includes a message passing interface MPI function.

3. The method according to claim 1 or 2, characterized in that: The first dictionary further includes a first description information set, the first description information set includes at least one description information, and the at least one description information includes description information for describing the semantics of each symbol string in the first dictionary; When the function call records in at least two log records in the first trace log have the same semantic structure, the symbol string used to characterize the function call records in the at least two log records in the first dictionary corresponds to a piece of description information in the first description information set.

4. The method according to claim 3, characterized in that: When the first process is a process of a target application, the target application further includes a second process, and after compressing function call records in a second trace log generated during the running of the second process, a second dictionary is obtained, and the second dictionary includes a second description information set; The method further comprises: When it is determined that the amount of different description information in the first description information set and the second description information set exceeds a threshold, the first description information set and the second description information set are compressed according to text similarities of the different description information in the first description information set and the second description information set.

5. The method according to claim 4, characterized in that The method further comprises: When it is determined that the amount of different description information in the first description information set and the second description information set is less than the threshold, the first description information set and the second description information set are merged.

6. The method according to any one of claims 1 to 5, characterized in that When the first process is a process of a target application, the target application further includes a second process, and after compressing function call records in a second trace log generated during the running of the second process, a second grammar set is obtained; the method further includes: The first grammar set and the second grammar set are merged according to the communication of functions between the first process and the second process.

7. The method according to any one of claims 4 to 6, characterized in that The first process and the second process run in different nodes.

8. The method according to any one of claims 1 to 7, characterized in that Each log record in the first trace log also includes time data, and the time data includes the start time of calling the communication function and the calling duration; the method also includes: According to the same call duration in the first trace log, the time data in the first trace log is compressed.

9. The method according to any one of claims 1 to 8, characterized in that The hardware resources occupied by the first process in the node are first hardware resources; the method further includes: Acquire a first data set, where the first data set includes performance data of the first hardware resource at multiple times during the running of the first process; The data in the first data set that is within each cluster range is represented by a preset value corresponding to each cluster range, so as to obtain a second data set that is obtained by compressing the first data set.

10. The method according to claim 9, characterized in that The performance data includes at least one of the following: The number of instructions per cycle IPC, cache miss rate CMR, cache hit rate CHR and branch prediction misrate BMR.

11. The method according to claim 9 or 10, characterized in that: When the first process is a process of a target application, the target application further includes a second process, the hardware resources occupied by the second process in the node are second hardware resources, the third data set includes performance data of the second hardware resources at multiple times during the running of the second process, and the fourth data set is obtained by compressing the third data set by using the preset value corresponding to each clustering range; the method further includes: The data in the second data set and the fourth data set that are within the range of each cluster are characterized by a preset value corresponding to the range of each cluster, so as to achieve compression of the second data set and the fourth data set.

12. A data compression device, characterized in that: include: an acquisition unit, configured to acquire a first trace log generated during the running of a first process; the first trace log includes at least one log record, each log record in the first trace log includes a function call record when the first process calls a communication function, and the communication function is a function for performing communication; A processing unit is used to construct a first dictionary and a first grammar set according to the function call records in the first trace log to achieve compression of the function call records in the first trace log; wherein the first dictionary includes at least one symbol string, and the first grammar set includes at least one grammar tree; for the first function call record included in any log record in the first trace log, the first symbol string in the first dictionary is used to represent the first function call record, and the first grammar tree in the first grammar set is used to represent the function call relationship in the first function call record.

13. The device according to claim 12, characterized in that The communication function includes a message passing interface MPI function.

14. The device according to claim 12 or 13, characterized in that The first dictionary further includes a first description information set, the first description information set includes at least one description information, and the at least one description information includes description information for describing the semantics of each symbol string in the first dictionary; When the function call records in at least two log records in the first trace log have the same semantic structure, the symbol string used to characterize the function call records in the at least two log records in the first dictionary corresponds to a piece of description information in the first description information set.

15. The device according to claim 14, characterized in that When the first process is a process of a target application, the target application further includes a second process, and after compressing function call records in a second trace log generated during the running of the second process, a second dictionary is obtained, and the second dictionary includes a second description information set; The processing unit is further used to compress the first description information set and the second description information set according to the text similarity of the different description information in the first description information set and the second description information set when it is determined that the number of different description information in the first description information set and the second description information set exceeds a threshold.

16. The device according to claim 15, characterized in that The processing unit is further configured to merge the first description information set and the second description information set when it is determined that the number of different description information in the first description information set and the second description information set is less than the threshold.

17. The device according to any one of claims 12 to 16, characterized in that When the first process is a process of a target application, the target application further includes a second process, and after compressing function call records in a second trace log generated during the running of the second process, a second grammar set is obtained; The processing unit is further configured to merge the first grammar set and the second grammar set according to the communication of functions between the first process and the second process.

18. The device according to any one of claims 15 to 17, characterized in that The first process and the second process run in different nodes.

19. The device according to any one of claims 12 to 18, characterized in that Each log record in the first trace log also includes time data, and the time data includes the start time of calling the communication function and the calling duration; The processing unit is further configured to compress the time data in the first trace log according to the same call duration in the first trace log.

20. The device according to any one of claims 12 to 19, characterized in that The hardware resources occupied by the first process in the node are first hardware resources; The acquisition unit is further configured to acquire a first data set, wherein the first data set includes performance data of the first hardware resource at multiple times during the running of the first process; The processing unit is further configured to characterize the data in the first data set that is within each cluster range by using a preset value corresponding to each cluster range, so as to obtain a second data set that is obtained by compressing the first data set.

21. The device according to claim 20, characterized in that The performance data includes at least one of the following: The number of instructions per cycle IPC, cache miss rate CMR, cache hit rate CHR and branch prediction misrate BMR.

22. The device according to claim 20 or 21, characterized in that When the first process is a process of a target application, the target application also includes a second process, the hardware resources occupied by the second process in the node are second hardware resources, the third data set includes performance data of the second hardware resources at multiple times during the running of the second process, and a fourth data set is obtained by compressing the third data set by using the preset value corresponding to each cluster range; The processing unit is further configured to characterize the data in the second data set and the fourth data set that are within the range of each cluster by using a preset value corresponding to the range of each cluster, so as to achieve compression of the second data set and the fourth data set.

23. A data compression device, characterized in that: include: A memory, a communication interface and one or more processors, wherein the one or more processors receive or send data through the communication interface, and the one or more processors are configured to read program instructions stored in the memory to execute the method according to any one of claims 1 to 11.

24. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes program instructions. When the program instructions are executed on a computer or a processor, the computer or the processor executes the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data compression method and device

    CN118659790A

  • Large-scale parallel program property-predication realizing method

    CN101650687A

  • MPI (message passing interface) parallel program load problem three-dimensional visualized analysis method suitable for large-scale cluster

    CN103019852A

  • Risk assessment method and device for software development kit, equipment and medium

    CN114186242A

  • Log processing method and device, computer readable storage medium and terminal

    CN115390847A