Method, device and electronic equipment for processing call record files
By determining the target number of collection processes based on the CPU and memory usage within a preset time period, the problem of system crash when the business analysis system processes a large number of call document files in a short period of time is solved, achieving stable and efficient processing of the system.
Patent Information
- Application Number
- CN202010244051.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-31
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2040-03-31
AI Technical Summary
When the business analysis system processes a large number of bill files in a short period of time, it is easy to cause the system to crash. Existing technologies cannot effectively solve this problem by increasing the number of parallel processes or the preset number.
By obtaining the CPU and memory usage of the collection process within the preset time period, the target number of collection processes to be initiated is determined based on the current host usage and preset rules, and the target number of collection processes are started to process the dialog file.
It effectively avoids system crashes, improves system stability and efficiency when processing a large number of bill files, and ensures the normal operation of the business analysis system.
Smart Images

Figure CN113065884B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method, device and electronic equipment for processing a call record file. Background Art
[0002] In the era of big data, call record files are one of the most important data sources for operators. Processing call record files is the basis for subsequent analysis. Existing technologies usually use business analysis systems to process call record files generated on the billing side host.
[0003] Since the host on the billing side may crash or be affected by network anomalies, a large number of call record files may accumulate on the host on the billing side in a short period of time, which requires the business analysis system to process the accumulated call record files in a short period of time.
[0004] In some scenarios, the method of using a preset number of processes to process call record files will increase the number of call record files processed by each process when the business analysis system needs to process a large number of files in a short period of time, which may easily cause the business analysis system to crash. The method of increasing the number of parallel processes to process a large number of files in a short period of time may also easily cause the business analysis system to crash due to the increase in the number of parallel processes. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a method, device and electronic device for processing call record files, so as to solve the problem that the business analysis system is prone to system crash when processing a large number of collected call record files in a short time.
[0006] In order to solve the above technical problems, the embodiment of the present invention is implemented as follows:
[0007] In the first aspect, an embodiment of the present invention provides a method for processing call record files, including: obtaining the average CPU usage of the collection process within a preset time period, and the average memory usage of the collection process within the preset time period; determining the target number of collection processes to be initiated according to preset rules based on the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, and the average memory usage of the collection process within the preset time period; starting the target number of collection processes to process the call record files to be processed.
[0008] In the second aspect, an embodiment of the present invention provides a device for processing call record files, the device comprising: a first acquisition module, used to obtain the average CPU usage of the collection process within a preset time period, and the average memory usage of the collection process within the preset time period; a determination module, used to determine the target number of collection processes to be initiated according to preset rules based on the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, and the average memory usage of the collection process within the preset time period; a processing module, used to start the target number of collection processes and process the call record files to be processed.
[0009] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the steps of the method for processing call record files as described in the first aspect.
[0010] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for processing a call record file as described in the first aspect are implemented.
[0011] It can be seen from the technical solution provided by the above embodiments of the present invention that the embodiments of the present invention obtain the average CPU usage of the collection process within a preset time period, the average memory usage of the collection process within a preset time period, and determine the target number of collection processes to be initiated according to preset rules based on the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, and the average memory usage of the collection process within the preset time period. Then, the target number of collection processes are started to process the call record files to be processed, thereby effectively solving the problem that the business analysis system is prone to system crashes when processing a large number of collected call record files in a short time. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0013] Figure 1 A schematic diagram of a first flow chart of a method for processing a call record file provided by an embodiment of the present invention;
[0014] Figure 2 A second flow chart of the method for processing a call record file provided by an embodiment of the present invention;
[0015] Figure 3 A third flow chart of the method for processing a call record file provided by an embodiment of the present invention;
[0016] Figure 4 A fourth flow chart of a method for processing a call record file provided by an embodiment of the present invention;
[0017] Figure 5 A fifth flow chart of the method for processing a call record file provided by an embodiment of the present invention;
[0018] Figure 6 A schematic diagram of the module composition of a device for processing a call record file provided by an embodiment of the present invention;
[0019] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The embodiment of the present invention provides a method, device and electronic device for processing a call record file.
[0021] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0022] like Figure 1 As shown, an embodiment of the present invention provides a method for processing a call record file, and the execution subject of the method can be a server, wherein the server can be an independent server or a server cluster composed of multiple servers, and the server can be a server capable of performing network operation processing, such as a call record file processing server, a business analysis system server, etc. The method can specifically include the following steps:
[0023] In S101, the average CPU usage rate of the collection process within a preset time period and the average memory usage rate of the collection process within a preset time period are obtained.
[0024] Taking the call bill file processing server as an example, a monitoring program can be pre-set in the call bill file processing server, and the monitoring program can be used to count the CPU usage rate of each call bill collection process within a unit time, and the memory usage rate of each call bill collection process. When the collection and storage program of the call bill file processing server is started, the CPU usage rate of each call bill collection process and the memory usage rate of each call bill collection process within a preset time period are obtained, and the average CPU usage rate of the collection process within the preset time period and the average memory usage rate of the collection process within the preset time period are calculated.
[0025] In S102, according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process in a preset time period, and the average memory usage of the collection process in a preset time period, the target number of collection processes to be initiated is determined according to preset rules.
[0026] The preset rule may be to determine the second preset number of collection processes to be collected that can be called by the current host based on the current host CPU usage rate and the average CPU usage rate of the collection process in a preset time period. Determine the third preset number of collection processes to be collected that can be called by the current host based on the current host memory usage rate and the average memory usage rate of the collection process in a preset time period. Read the maximum number of processes that can be called in the configuration information, and select the minimum number of processes from the second preset number, the third preset number and the maximum number of processes read as the target number of collection processes to be initiated.
[0027] In S103, the target number of collection processes are started to process the call record files to be processed.
[0028] In implementation, after the target number of collection processes to be initiated is determined through the processing of S103, the target number of collection processes can be initiated to process the call record files to be processed.
[0029] It can be seen from the technical solution provided by the above embodiments of the present invention that the embodiments of the present invention obtain the average CPU usage of the collection process within a preset time period, the average memory usage of the collection process within a preset time period, and according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, the average memory usage of the collection process within the preset time period, according to preset rules, determine the target number of collection processes to be initiated, start the target number of collection processes, and process the call record files to be processed, thereby effectively solving the problem that the call record file processing server is prone to system crashes when processing a large number of collected call record files in a short time.
[0030] Further, such as Figure 2As shown, the above method also includes the following processing methods, and the details can refer to the processing of S104-S105 below.
[0031] In S104, a call record file is obtained.
[0032] The above-mentioned bill file may be a bill bill file generated by the billing side host processing the original bill, and the bill bill file may include a text message bill file, a traffic bill file, a voice bill file, etc.
[0033] In S105, when the number of acquired bill files is greater than a first preset threshold, a first preset number of bill files are selected as bill files to be processed.
[0034] The above-mentioned call bill files to be processed can be a preset number of call bill files selected from the acquired call bill files, or can also be call bill files of a preset category selected from the acquired call bill files. For example, the preset category of call bill files can be SMS billing call bill files, traffic billing call bill files, and voice call billing call bill files, etc.
[0035] It should be noted that a configuration file can be pre-defined on the call record file processing server, which can pre-configured the information of the call record file to be obtained (such as the IP address where the call record file to be obtained is stored, the reading directory of the call record file to be obtained, the mode supported by the call record file transfer protocol to be obtained, the business type grouping of the call record file to be obtained), the maximum number of processes that the call record file processing server can call, the number of processes that the call record file processing server can start, the maximum number of clients of the call record file processing server host CPU, the program scheduling batch start time, the incoming call record file information (such as the incoming call record file directory, the incoming file merging capacity configuration information), the maximum number of files read by the call record file server in each batch acquisition task, and other information.
[0036] Specifically, taking the example of a call record file processing server obtaining a call record file from a host on the billing side, the call record file processing server may be a business analysis system server. When the call record file processing server obtains the call record file from the host on the billing side, the call record file processing server may read the configuration file, and obtain the call record file from the host on the billing side according to the program scheduling batch start time (e.g., every 5 minutes) in the configuration file, the mode supported by the transmission protocol of the call record file to be obtained, and the IP address where the call record file to be obtained is stored.
[0037] Then, the call bill file processing server can save the call bill file obtained from the billing side host into array n. And compare the file name in array n with the file name of the historical period (such as the file name of the call bill file obtained in the previous period), eliminate the files contained in array n that have the same file name as the file of the historical period, and count the number of call bill files obtained after the above elimination (such as m). Read the maximum number of files that the call bill file server can read per batch acquisition task in the configuration information. If the maximum number of files that the call bill file server can read is less than the number of call bill files obtained after elimination, select the call bill file with the maximum number of files that the call bill file server can read as the call bill file to be processed.
[0038] Further, such as Figure 3 As shown, the specific processing method of the above S102 can be various. An optional processing method is provided below. For details, please refer to the processing of the following S1021-S1023.
[0039] In S1021, when the current host CPU usage is less than the second preset threshold, the second preset number of collection processes to be collected is determined according to the current host CPU usage, the average CPU usage of the collection processes in the preset time period, and the second preset threshold.
[0040] In implementation, when the host CPU usage of the call record file processing server is higher than a preset threshold, it can easily cause the host to run slowly, thereby affecting the efficiency of the call record file processing server in processing call records. Therefore, the host CPU usage of the call record file processing server usually needs to be less than a preset threshold (such as a second preset threshold). For example, the second preset threshold can be 80%.
[0041] Specifically, suppose the current host CPU usage is P, and the average CPU usage of the collection process in the preset time period is The second preset threshold is 0.8, and the second preset number is S1. When the current host CPU usage is less than the second preset threshold, the second preset number of collection processes to be collected can be determined by the following formula:
[0042] In S1022, when the current host memory usage is less than the third preset threshold, the third preset number of collection processes to be collected is determined according to the current host memory usage, the average memory usage of the collection process in the preset time period, and the third preset threshold.
[0043] In implementation, when the memory usage of the call record file processing server is higher than a certain preset threshold, it is also easy to cause the host to run slowly, thereby affecting the efficiency of the call record file processing server in processing the call record. Therefore, the host memory usage of the call record file processing server usually needs to be less than a certain preset threshold (such as a third preset threshold). The third preset threshold can be the same as the second preset threshold or different from the second preset threshold. For example, the third preset threshold can also be 80%.
[0044] Specifically, suppose the current host memory usage is R, and the average memory usage of the collection process in the preset time period is The third preset threshold is 0.8, and the third preset number is S2. When the current host memory usage is less than the third preset threshold, the third preset number of collection processes to be collected can be determined by the following formula:
[0045] In S1023, the number of collection processes that meets the preset number rule is selected from the second preset number, the third preset number and the fourth preset number, and is determined as the target number of collection processes to be initiated, wherein the fourth preset number is the number of collection processes preset by the system.
[0046] It should be noted that the number of collection processes preset by the system can be the maximum number of processes S3 that can be called by the call record file processing server in the configuration information, that is, the third preset number can be S3. The number of collection processes that meets the preset number rule can be the minimum number of processes selected from the second preset number, the third preset number and the fourth preset number.
[0047] In implementation, when the call record file processing server detects that the current host CPU usage is less than the second preset threshold, and the current host memory usage is less than the third preset threshold, that is, P < the second preset threshold, and R < the third preset threshold, the target number S of the collection process to be initiated can be determined by the following formula: For example, if the second preset threshold is 80%, and the third preset threshold is also 80%, then the above formula may be:
[0048] When P < the second preset threshold value and R > the third preset threshold value, the target number S of the collection processes to be initiated can be determined by the following formula:
[0049] When P>the second preset threshold value and R<the third preset threshold value, the target number S of the collection processes to be initiated can be determined by the following formula:
[0050] It should be noted that when P ≥ the second preset threshold and R ≥ the third preset threshold, the system terminates the process of determining the target number of collection processes to be initiated until the current host CPU usage is less than the second preset threshold, or the current host memory usage is less than the third preset threshold, and then starts the process of determining the target number of collection processes to be initiated.
[0051] Further, such as Figure 4 As shown, the specific processing method of the above S103 can be various. An optional processing method is provided below. For details, please refer to the processing of S1031 below.
[0052] In S1031, the call record files to be processed are evenly distributed to the target number of collection processes, so that the target number of collection processes process the call record files to be processed.
[0053] During implementation, in order to avoid excessive number of call bill files being allocated to certain collection processes among the target number of collection processes within the same collection cycle, thereby affecting the processing efficiency of the collection processes in processing call bill files, therefore, in an embodiment of the present application, after determining the number of call bill files to be processed and the target number of collection processes to be initiated, it is also necessary to evenly distribute the call bill files to be processed to the target number of collection processes so that the target number of collection processes can process the call bill files to be processed.
[0054] Specifically, for example, if the number of call slip files to be processed is determined to be m, the target number of collection processes to be initiated is S, and the number of call slip files allocated to each collection process is a, then a=m / S.
[0055] Furthermore, considering that after the call bill processing server cleans and merges the collected call bill files, the capacity of the merged call bill files may be greater than the capacity configuration of the storage file, which may lead to the situation that the storage cannot be performed. Therefore, if Figure 5 As shown, after the call record file to be processed is processed, the following processing steps S106-S107 may be performed.
[0056] In S106, according to the capacity configuration of the incoming files, the processed call record files are merged into a plurality of incoming files matching the capacity configuration.
[0057] During implementation, after reading the call record files collected by the collection process, the call record file processing server can read the incoming file merging capacity configuration information and the call record file cleaning rules in the configuration file, allocate a preset number of cleaning and merging processes, clean the call record files collected by the collection process according to the cleaning rules, and then merge the cleaned call record files according to the incoming file merging capacity configuration information into multiple incoming files that comply with the incoming rules and match the capacity configuration.
[0058] In S107, the storage file is processed for storage.
[0059] In implementation, the above-mentioned storage files may be processed according to the service type of the call record file and the data cycle of collecting the call record file.
[0060] It can be seen from the technical solution provided by the above embodiments of the present invention that the embodiments of the present invention obtain the average CPU usage of the collection process within a preset time period, the average memory usage of the collection process within a preset time period, and according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, the average memory usage of the collection process within the preset time period, according to preset rules, determine the target number of collection processes to be initiated, start the target number of collection processes, and process the call record files to be processed, thereby effectively solving the problem that the business analysis system is prone to system crashes when processing a large number of collected call record files in a short time.
[0061] Furthermore, by storing the processed stored files according to the storage file capacity configuration, the problem that the capacity of the merged bill file may be greater than the storage file capacity configuration, resulting in the merged bill file being unable to be stored, is solved.
[0062] Corresponding to the method for processing a call record file provided in the above embodiment, based on the same technical concept, an embodiment of the present invention further provides a device for processing a call record file. Figure 6 A schematic diagram of a first module composition of a device for processing a call record file provided in an embodiment of the present invention, wherein the device for processing a call record file is used to execute Figures 1 to 5 The processing method of the call record file is described, such as Figure 6 As shown, the device for processing the call record file includes: a first acquisition module 601 , a determination module 602 and a processing module 603 .
[0063] The first acquisition module 601 is used to obtain the average CPU usage of the collection process within a preset time period and the average memory usage of the collection process within a preset time period. The determination module 602 is used to determine the target number of collection processes to be initiated according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, and the average memory usage of the collection process within the preset time period, according to preset rules. The processing module 603 is used to start the target number of collection processes and process the call list files to be processed.
[0064] It can be seen from the technical solution provided by the above embodiments of the present invention that the embodiments of the present invention obtain the average CPU usage of the collection process within a preset time period, the average memory usage of the collection process within a preset time period, and according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, the average memory usage of the collection process within the preset time period, according to preset rules, determine the target number of collection processes to be initiated, start the target number of collection processes, and process the call record files to be processed, thereby effectively solving the problem that the business analysis system is prone to system crashes when processing a large number of collected call record files in a short time.
[0065] Optionally, the above device also includes: a second acquisition module and a selection module.
[0066] The second acquisition module is used to acquire call record files. The selection module is used to select a first preset number of call record files as the call record files to be processed when the number of the acquired call record files is greater than a first preset threshold.
[0067] Optionally, the above-mentioned determination module 602 includes: a first determination unit, a second determination unit, and a third determination unit.
[0068] The first determination unit is used to determine the second preset number of collection processes to be collected according to the current host CPU usage, the average CPU usage of the collection process in the preset time period, and the second preset threshold when the current host CPU usage is less than the second preset threshold. The second determination unit is used to determine the third preset number of collection processes to be collected according to the current host memory usage, the average memory usage of the collection process in the preset time period, and the third preset threshold when the current host memory usage is less than the third preset threshold. The third determination unit is used to select the number of collection processes that meet the preset number rule from the second preset number, the third preset number, and the fourth preset number, and determine it as the target number of collection processes to be initiated, wherein the fourth preset number is the number of collection processes preset by the system.
[0069] Optionally, the processing module 603 is used to evenly distribute the call record files to be processed to the target number of collection processes, so that the target number of collection processes process the call record files to be processed.
[0070] Optionally, the above device also includes: a merging module and a warehousing module.
[0071] The merging module is used to merge the processed call bill files into multiple storage files matching the capacity configuration according to the capacity configuration of the storage files after processing the to-be-processed call bill files. The storage module is used to perform storage processing on the storage files.
[0072] It can be seen from the technical solution provided by the above embodiments of the present invention that the embodiments of the present invention obtain the average CPU usage of the collection process within a preset time period, the average memory usage of the collection process within a preset time period, and according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, the average memory usage of the collection process within the preset time period, according to preset rules, determine the target number of collection processes to be initiated, start the target number of collection processes, and process the call record files to be processed, thereby effectively solving the problem that the business analysis system is prone to system crashes when processing a large number of collected call record files in a short time.
[0073] The device for processing a call record file provided in the embodiment of the present invention can implement each process in the embodiment corresponding to the method for processing a call record file, and will not be described again here to avoid repetition.
[0074] It should be noted that the device for processing call record files provided in the embodiment of the present invention and the method for processing call record files provided in the embodiment of the present invention are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned method for processing call record files, and the repeated parts will not be repeated.
[0075] Corresponding to the method for processing a call record file provided in the above embodiment, based on the same technical concept, an embodiment of the present invention further provides an electronic device, which is used to execute the method for processing a call record file. Figure 7 A schematic diagram of the structure of an electronic device for implementing various embodiments of the present invention is shown in FIG. Figure 7As shown. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 701 and memory 702, and the memory 702 may store one or more storage applications or data. Among them, the memory 702 can be a temporary storage or a permanent storage. The application stored in the memory 702 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 701 can be configured to communicate with the memory 702 to execute a series of computer executable instructions in the memory 702 on the electronic device. The electronic device may also include one or more power supplies 703, one or more wired or wireless network interfaces 704, one or more input and output interfaces 705, and one or more keyboards 706.
[0076] Specifically in this embodiment, the electronic device includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the following method steps: obtaining the average CPU usage of the collection process within a preset time period and the average memory usage of the collection process within a preset time period; determining the target number of collection processes to be initiated according to preset rules based on the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, and the average memory usage of the collection process within the preset time period; starting the target number of collection processes to process the call list files to be processed.
[0077] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the following method steps are implemented: obtaining the average CPU usage of the collection process within a preset time period and the average memory usage of the collection process within the preset time period; determining the target number of collection processes to be initiated according to preset rules based on the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, and the average memory usage of the collection process within the preset time period; starting the target number of collection processes and processing the call record files to be processed.
[0078] It can be seen from the technical solution provided by the above embodiments of the present invention that the embodiments of the present invention obtain the average CPU usage of the collection process within a preset time period, the average memory usage of the collection process within a preset time period, and according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process within the preset time period, the average memory usage of the collection process within the preset time period, according to preset rules, determine the target number of collection processes to be initiated, start the target number of collection processes, and process the call record files to be processed, thereby effectively solving the problem that the business analysis system is prone to system crashes when processing a large number of collected call record files in a short time.
[0079] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0080] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0081] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0082] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0083] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0084] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0085] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0086] It is to be understood that the embodiments described in the embodiments of the present invention may be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present invention or a combination thereof.
[0087] For software implementation, the technology described in the embodiments of the present invention can be implemented by a module (such as a process, function, etc.) that performs the functions described in the embodiments of the present invention. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0088] It should also be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0090] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in the field can make various changes and modifications to the present invention without departing from the scope of the present invention and the claims. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A method for processing a call record file, characterized in that: The method comprises: Get the call record file; When the number of the acquired call record files is greater than a first preset threshold, selecting the first preset number of call record files as the call record files to be processed; Get the average CPU usage of the collection process within the preset time period and the average memory usage of the collection process within the preset time period; Determine the target number of collection processes to be initiated according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process in the preset time period, and the average memory usage of the collection process in the preset time period, according to preset rules; Initiate the target number of collection processes to process the call record files to be processed; The method of determining the target number of collection processes to be initiated according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process in a preset time period, and the average memory usage of the collection process in a preset time period, according to preset rules, includes: When the current host CPU usage is less than a second preset threshold, determining a second preset number of collection processes to be collected according to the current host CPU usage, the average CPU usage of the collection processes in the preset time period, and the second preset threshold; When the current host memory usage is less than the third preset threshold, determining a third preset number of collection processes to be collected according to the current host memory usage, the average memory usage of the collection processes in the preset time period, and the third preset threshold; From the second preset number, the third preset number and the fourth preset number, the number of collection processes that meets the preset number rule is selected to determine the target number of collection processes to be initiated, wherein the fourth preset number is the number of collection processes preset by the system.
2. The method according to claim 1, characterized in that The step of starting the target number of collection processes and processing the call record files to be processed includes: The call record files to be processed are evenly distributed to the target number of collection processes, so that the target number of collection processes process the call record files to be processed.
3. The method according to claim 1, characterized in that After processing the call record file to be processed, it also includes: According to the capacity configuration of the incoming files, the processed call record files are merged into a plurality of incoming files matching the capacity configuration; The storage file is processed for storage.
4. A device for processing a call record file, characterized in that: The device comprises: A selection module, configured to select a first preset number of call record files as call record files to be processed when the number of the acquired call record files is greater than a first preset threshold; The first acquisition module is used to acquire the average CPU usage of the collection process within a preset time period and the average memory usage of the collection process within a preset time period; The second acquisition module is used to acquire the call record file; A determination module, used to determine the target number of collection processes to be initiated according to the current host CPU usage, the current host memory usage, the average CPU usage of the collection process in the preset time period, and the average memory usage of the collection process in the preset time period, according to preset rules; A processing module, used to start the target number of collection processes and process the call record files to be processed; The determining module comprises: A first determining unit, configured to determine, when the current host CPU usage is less than a second preset threshold, a second preset number of collection processes to be collected according to the current host CPU usage, the average CPU usage of the collection processes within the preset time period, and the second preset threshold; A second determining unit is used to determine a third preset number of collection processes to be collected according to the current host memory usage, the average memory usage of the collection processes in the preset time period, and the third preset threshold value when the current host memory usage is less than the third preset threshold value; The third determination unit is used to select the number of collection processes that meet the preset number rules from the second preset number, the third preset number and the fourth preset number, and determine it as the target number of collection processes to be initiated, wherein the fourth preset number is the number of collection processes preset by the system.
5. The device according to claim 4, characterized in that The device also includes: A merging module, configured to, after processing the to-be-processed call record files, merge the processed call record files into a plurality of storage files matching the capacity configuration according to the capacity configuration of the storage files; The storage module is used to perform storage processing on the storage file.
6. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the steps of the method for processing the call record file as described in any one of claims 1-3.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for processing a call record file according to any one of claims 1 to 3 are implemented.
