Log File Download Method, Device and Electronic Device
By obtaining the unified domain name list of CDN manufacturers and downloading log files based on the domain name, the cumbersome operation problems caused by the differences in interfaces of different CDN manufacturers are solved, and efficient log file download is achieved.
Patent Information
- Application Number
- CN202211021391.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-08-24
AI Technical Summary
The log file download interfaces provided by different CDN manufacturers are different, which leads to the need to design different programs, which are cumbersome and inconvenient to maintain, resulting in inefficient log file download.
By obtaining the domain name list of the target object from the pre-configured target interface, downloading the log files generated by the service corresponding to the domain name according to the domain name in the domain name list, using the unified interface layer to block the differences in the acquisition method of the domain name list of each CDN manufacturer, simplifying the operation process.
It improves the download efficiency of log files, simplifies operational processes, reduces program maintenance work, and improves the reliability and reliability of downloads.
Smart Images

Figure CN115442360B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of log file processing, and in particular, to a method, device and electronic device for downloading log files. Background Art
[0002] A content delivery network (CDN) is a distributed network composed of edge node server groups distributed in different regions. The CDN is widely used and supports content acceleration for multiple industries and multiple scenarios. Currently, many enterprises will access CDN services provided by multiple manufacturers. In order to verify the performance of the manufacturers and reconcile accounts later, it is necessary to download log files provided by different CDN manufacturers.
[0003] In some scenarios, the log file download interfaces provided by different CDN manufacturers are different. Different programs need to be designed for different CDN manufacturers to download log files. Thus, designing different programs for different CDN manufacturers to download log files is not only cumbersome in operation, but also very inconvenient for subsequent maintenance of many programs, resulting in low efficiency of log file download. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a method, device and electronic device for downloading log files, which improves the efficiency of downloading log files.
[0005] In order to solve the above technical problems, the embodiments of the present application are implemented as follows:
[0006] In a first aspect, the embodiments of the present application provide a method for downloading log files, including: obtaining a domain name list of at least one target object from a pre-configured target interface, where the domain name list of one target object includes different domain names configured for different services of one target object, and different services generate different log files; downloading the log files generated by the services corresponding to the domain names according to the domain names in the domain name list.
[0007] In a second aspect, the embodiments of the present application provide a device for downloading log files, including:
[0008] An obtaining module, configured to obtain a domain name list of at least one target object from a pre-configured target interface, where the domain name list of one target object includes different domain names configured for different service information of one target object; a downloading module, configured to download the log files generated by the services corresponding to the domain names according to the domain names in the domain name list.
[0009] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus; wherein, the processor, the communication interface, and the memory complete communication with each other through the bus; the memory is used to store a computer program; the processor is used to execute the program stored on the memory to implement the steps of the log file download method as described in the first aspect.
[0010] In a fourth aspect, an embodiment of the present application 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 log file download method as described in the first aspect are implemented.
[0011] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a program or an instruction to implement the steps of the log file download method as described in the first aspect.
[0012] As can be seen from the technical solutions provided by the embodiments of the present application above, by obtaining a domain name list of at least one target object from a pre-configured target interface, wherein the domain name list of a target object includes different domain names configured for different service information of a target object, and downloading log files generated by services corresponding to the domain names according to the domain names in the domain name list. In this way, different target objects correspond to the domain name list, multiple domain names in a domain name list correspond to different services, and each service will generate log files during operation. When it is necessary to download log files generated by the services of a certain target object, only need to download the log files corresponding to the domain names according to the instructions of the domain names in the domain name list of the target object, without designing different programs for different target objects to download log files, which simplifies the operation and improves the download efficiency of log files. Description of the Drawings
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0014] Figure 1 It is a schematic flowchart of the log file download method provided by the embodiment of the present application;
[0015] Figure 2 It is a schematic diagram of the functional modules of a log file download device provided by the embodiment of the present application;
[0016] Figure 3 The structural schematic diagram of the electronic device provided by the embodiment of the present application. Specific embodiments
[0017] The purpose of the embodiment of the present application is to provide a method, device and electronic device for downloading log files, which improves the downloading efficiency of log files.
[0018] 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 application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
[0019] In order to solve the above technical problems, the embodiments of the present application provide a method, device and electronic device for downloading log files. The method, device and electronic device for downloading log files provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0020] As Figure 1 shown, the embodiment of the present application provides a method for downloading log files. The execution subject of this method can be a server. Among them, the server can be an independent server or a server cluster composed of multiple servers. The method for downloading log files can specifically include the following steps S101-S105:
[0021] In step S101, obtain the domain name list of at least one target object from a pre-configured target interface.
[0022] Among them, the domain name list of a target object includes different domain names configured for different services of a target object, and different services generate different log files.
[0023] Specifically, the target interface refers to a unified interface configured through Java for different target objects. The target objects refer to different CDN providers. For CDN providers, they are used to provide CDN services to users. When a CDN provider provides CDN services to users, log files will be generated, that is, log files will be generated when users access CDN providers. The domain name list contains multiple domain names, which are configured for different services of the target object. That is to say, domain names are configured for different services. Among them, configuring domain names for different services can be configuring domain names according to the types and traffic volumes of different services. In the case where a target object has multiple services, there are corresponding multiple domain names in the domain name list, and each domain name has a corresponding relationship with the service. During the operation of each service, log files are generated according to the operation conditions of the service at different time periods, or log files are generated according to a predetermined time granularity. The span of this time granularity can be 5 minutes, 1 hour, etc.
[0024] Furthermore, the ways of providing domain name lists by each CDN provider are different. For example, the way for cdn1 provider to obtain is: when accessing the link https: / / cdn.cdn1.com / getDomain, httpheader1 and header2 need to be configured; the way for Cdn2 provider to obtain is: https: / / cdn.cdn2.com / domainlist, and when accessing the link, http header3 and urlparams need to be configured; the way for Cdn3 provider to obtain is: obtained through java api. The way for Cdn4 provider to obtain is: downloaded through a network disk. In this way, the unified interface layer implemented through Java polymorphism can shield the differences in the ways of obtaining domain name lists provided by each provider, and obtain the domain name lists provided by each CDN provider through the unified interface layer.
[0025] In step S103, download the log files generated by the service corresponding to the domain name in the domain name list.
[0026] Specifically, the domain name contains the navigation information of the log file for the user to access the target object. The user accesses the log file download description information of the log file to be downloaded provided by the target object according to the indication of this navigation information. The log file download description information includes but is not limited to: the domain name provided by the target object, the download address of the log, the size of the log file, the type of the log file, the time when the log file is generated, the verification type of the log, and the log verification value, etc. Among them, the size of the log file refers to the memory space occupied by the log file, the type of the log file refers to whether the log file is an update log type, a binary log type, a query log type, a slow query log type, etc., and the verification value of the log file can be an MD5 value.
[0027] For example, the following log file download description information can have the following forms:
[0028] "domain":"example.domain", / / The domain name corresponding to the log file
[0029] "downloadLink":https: / / example.download.com / example-2021-06-18.gz, / / The download address of the log file
[0030] "fileName":"example-2021-06-18.gz", / / The name of the log file
[0031] "fileSize":1000, / / The size of the log file
[0032] "fileSizeType":0, / / The size type of the log file, 0: size before decompression, 1: size after decompression
[0033] "timestamp":1655622242169, / / The time when the log file was generated
[0034] "verifyType":"md5", / / The verification type of the log file
[0035] "verifyValue":"fjdlakghasdguoasdfmlkdsajfdiaosjgfkla", / / The verification value of the log file
[0036] }
[0037] In a possible implementation, downloading the log files generated by the services corresponding to the domain names in the domain name list includes:
[0038] Obtaining the log file download description information provided by the target object corresponding to the domain name according to the domain name, where the log download description information indicates the log information of the log files generated by the services corresponding to the domain name; downloading the log files according to the indication of the log file download description information.
[0039] Specifically, for the target object, the domain names in the corresponding domain name list provide log file download description information for different services. The log file download description information indicates the log information of the log file to be downloaded. The log information includes, but is not limited to, the log file download address, the log file size, the log file name, and the log file verification information. After obtaining the log information, download the log file with the log file name from the log file download address. When downloading the log file, you can choose to download the log files within a certain time period. After the log file is downloaded, the log information of the downloaded log file can be compared with the log information in the log file download description information to ensure whether the log file is downloaded correctly. For example, compare whether the size of the downloaded log file is the same as the file size in the log file download description information, and use the log file verification information in the log file download description information to verify the correctness of the downloaded log file. Among them, the log file verification information includes, but is not limited to, the log verification type and the log verification value.
[0040] In a possible implementation manner, downloading the log file according to the indication of the log file download description information includes: adding the log file download description information to the download queue corresponding to the target object, taking out the log file download description information from the download queue, and downloading the log file corresponding to the domain name according to the indication of the log file download description information. Among them, the log file download description information includes the log file download address, the log file size, the log file name, and the log file verification information.
[0041] Specifically, in the embodiment of the present application, a download queue can be provided for each target object in redis, and the log file download description information obtained by using the target interface is added to the download queue corresponding to the target object. Among them, when downloading the log file, take out the log file download description information from the download queue, and take out the log file download description information in the order of the addition time of the log file download description information in the download queue. The log file download description information added to the download queue first is preferentially taken out. Correspondingly, the log file corresponding to the log file download description information preferentially taken out from the download queue is preferentially downloaded. If a certain log file corresponding to the log download description information in the download queue is downloaded, the high log file download description information is removed from the download queue.
[0042] In a possible implementation, each time a log file download description information is added to the download queue, a unique corresponding first identification code is configured for the log file download description information, and the log file download description information and the first identification code are in the form of a key-value pair. When the log file download description information corresponding to the first identification code changes, the log file download description information corresponding to the first identification code is updated to the new log file download description information, and the new log file download description information corresponds to the first identification code.
[0043] Specifically, the number of log files provided by the target object and the content of each log file may change. To be able to automatically identify the change in the number of log files, each time a log file download description information is added to the download queue, the setnx method of redis is used to set a first identification code key1 that is uniquely corresponding to this log file. Due to the mutex effect of the setnx method, only when the log file has not been downloaded will the log file download description information be added to the download queue. That is to say, only when there is no first identification code corresponding to a certain log file download description information in the download queue will the log file download description information be added to the download queue, avoiding the repeated addition of the same log file download description information to the download queue, thus causing unnecessary waste of download resources and improving the efficiency of log file download. Among them, the format of the first identification code key1 can be set as a combination of the name of the log file and the name of the target object. For example, it can be "${app}_download_already_${fileName}", where ${app} represents the name of the cdn manufacturer and ${fileName} represents the file name).
[0044] Furthermore, to avoid downloading incorrect log files due to changes in the content of the log files, the log file download description information can be set as the value of the first identification code key1, that is, the first identification code and the log file download description information exist in the form of a key-value pair. When the new log file download description information corresponding to the same first identification code is obtained, the size and verification value of the log file in the old log file download description information and the new log file download description information can be used to determine whether the content of the log file has changed. If it has changed, the value of the first identification code key1 can be updated to the new log file download description information, and at the same time, the new log file download description information is added to the download queue, and the old log file download description information is removed from the download queue, avoiding downloading the log file indicated by the old log file download description information, avoiding waste of download resources, and improving the efficiency of log file download.
[0045] In a possible implementation manner, downloading the log file corresponding to the domain name according to the indication of the log file download description information includes:
[0046] Downloading the log file to the target file system according to the indication of the log download description information. When downloading the log file, a uniquely corresponding second identification code is configured for the log file.
[0047] Specifically, the target file system can be the hdfs file system. When downloading the log file, multiple log file download description information can be obtained from the download queue by different servers. The log file download description information obtained by each server is different. Using multiple servers to download multiple log files simultaneously can further improve the download efficiency of the log files.
[0048] In order to avoid the problem that if the log file has changed during the download process, and the log file download description information of the log file is re-added to the download queue, resulting in a log file download conflict and causing the problem of retaining incorrect log files. Therefore, when downloading the log file, the setnx method of redis is used to set the second identification code key2 corresponding to the log file being downloaded. The format of the second identification code key2 can be set as a combination of the name of the log file and the name of the target object. For example, the format of the second identification code can be: "${app}_downloading_${fileName}", where ${app} represents the name of the target object and ${fileName} represents the name of the log file. The log of the corresponding log file being downloaded is set as the value of key2. That is to say, the second identification code key2 and the log of the log file being downloaded present a key-value pair form. During the download process of the log file, only the value of the second identification code key2 needs to be continuously updated to understand the download situation of the current log file. Since the same log file corresponds to a unique second identification code, when the log file corresponding to the second identification code is being downloaded, the log file download description information corresponding to the log file will not be re-added to the download queue. Only the value corresponding to the second identification code key2 needs to be updated until the log file is downloaded. It should be noted that the content of the downloaded log file includes the changed log content and the unchanged log content. By adopting this method, the problem of download conflict of the log files in the download queue is avoided, the retention of incorrect log files is avoided, and the reliability of the log file download is improved.
[0049] Through the technical solution provided by the embodiments of the present application, obtain the domain name list of at least one target object from a pre-configured target interface. Among them, the domain name list of one target object includes different domain names configured for different service information of one target object, and download the log file corresponding to the domain name according to the domain name in the domain name list. In this way, different target objects correspond to the domain name list, multiple domain names in a domain name list correspond to different services, and each service will generate a log file during operation. When it is necessary to download the log file generated by the service of a certain target object, only need to download the log file corresponding to the domain name according to the indication of the domain name in the domain name list of the target object, without designing different programs for different target objects to download the log file, which simplifies the operation and improves the download efficiency of the log file.
[0050] In a possible implementation manner, after downloading the log file according to the indication of the log file download description information, it further includes: obtaining the downloaded log file; comparing the downloaded log file with the log file download description information to obtain download information, where the download information indicates whether the log information of the downloaded log file is consistent with the log information indicated by the log file download description information; storing the download information in the target database. Obtain the download information from the target database and alarm the abnormal information in the download information.
[0051] Specifically, after the log file is downloaded, the log information of the downloaded log file can be obtained, including but not limited to the log file size, the name of the log file, the type of the log file, etc. Compare the log information of the downloaded log file with the log information in the log file download description information in the download queue. If the two log information is inconsistent, it means that the log file is downloaded incorrectly, and there is abnormal information in the corresponding download information. If the two log information is consistent, it means that the log file is downloaded correctly. And save the download information to the target database, where the target database can be a mysql database. In this way, the correctness of the downloaded log file is checked, which can improve the reliability of the log file download. In order to remind the user in time, an alarm can be made when there is abnormal information in the download information, so that relevant technicians can solve it in time, further improving the reliability of the log file download.
[0052] Furthermore, it is also possible to compare the number of all log files provided by a target object within a certain time period. For example, a user accesses the domain name list of a certain target object and downloads the log files of a certain domain name in the domain name list within a period of time. After the download of the log files corresponding to this domain name within this period of time is completed, the downloaded log files are stored in the target file system, and then the number of log files corresponding to this domain name in the target file system within this period of time is compared with the number of log files provided by this domain name within this period of time. If the number of log files in both cases is the same, it means that all the log files within this period of time have been downloaded. If the number of log files corresponding to this domain name in the target file system within this period of time is less than the number of log files provided by this domain name within this period of time, it means that there are missing downloads of the log files corresponding to this domain name during this period. If the number of log files corresponding to this domain name in the target file system within this period of time is greater than the number of log files provided by this domain name within this period of time, it means that there are duplicate downloads or incorrect downloads of the log files corresponding to this domain name during this period. After the latter two situations occur, it is necessary to check and process in a timely manner to further improve the reliability and accuracy of log file downloads.
[0053] In addition, the download information can also be displayed through a dashboard for users to clearly view the specific download information and improve the user experience.
[0054] Corresponding to the log file download method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides a log file download device. Figure 2 It is a schematic diagram of the module composition of the log file download device provided in the embodiment of the present application. This log file download device is used to execute the log file download method described in the above embodiment, as Figure 2 shown. The log file download device 200 includes: an acquisition module 201, configured to obtain a domain name list of at least one target object from a pre-configured target interface, where the domain name list of one target object includes different domain names configured for different services of one target object, and different services generate different log files. A download module 202, configured to download the log files generated by the service corresponding to the domain name according to the domain name in the domain name list.
[0055] Through the technical solution disclosed in the embodiments of the present application, obtain the domain name list of at least one target object from a pre-configured target interface. Among them, the domain name list of one target object includes different domain names configured for different service information of one target object, and download the log file corresponding to the domain name according to the domain name in the domain name list. In this way, different target objects correspond to the domain name list, multiple domain names in a domain name list correspond to different services, and each service will generate a log file during operation. When it is necessary to download the log file generated by the service of a certain target object, only need to download the log file corresponding to the domain name according to the indication of the domain name in the domain name list of the target object, without designing different programs for different target objects to download the log file, which simplifies the operation and improves the download efficiency of the log file.
[0056] In a possible implementation manner, the download module 202 is further configured to add the log file download description information to the download queue corresponding to the target object; take out the log file download description information from the download queue; download the log file generated by the service corresponding to the domain name according to the indication of the log file download description information, where the log file download description information includes the log file download address, the log file size, the log file name, and the log file verification information.
[0057] In a possible implementation manner, for each log file download description information added to the download queue, configure a uniquely corresponding first identification code for a log file download description information, and the log file download description information and the first identification code are in the form of a key-value pair.
[0058] In a possible implementation manner, when the log file download description information corresponding to the first identification code changes, update the log file download description information corresponding to the first identification code to the new log file download description information, and the new log file download description information corresponds to the first identification code.
[0059] In a possible implementation manner, the download module 202 is further configured to download the log file to the target file system according to the indication of the log file download description information; where, when downloading the log file, configure a uniquely corresponding second identification code for the log file.
[0060] In a possible implementation manner, the acquisition module 201 is further configured to acquire the downloaded log file; compare the downloaded log file with the log file download description information to obtain the download information, where the download information indicates whether the log information of the downloaded log file is consistent with the log information indicated by the log file download description information; store the download information in the target database.
[0061] In a possible implementation, the obtaining module 201 is further configured to obtain download information from a target database and alarm about abnormal information in the download information.
[0062] The log file download device provided by the embodiments of this application can implement each process in the corresponding embodiments of the above log file download method. To avoid repetition, details are not described here again.
[0063] It should be noted that the log file download device provided by the embodiments of this application and the log file download method provided by the embodiments of this application are based on the same inventive concept and have the same technical effects. Therefore, the specific implementation of this embodiment can refer to the implementation of the foregoing log file download method, and repeated parts are not described again.
[0064] Corresponding to the log file download method provided in the above embodiments, based on the same technical concept, the embodiments of this application also provide an electronic device, which is used to execute the above log file download method. Figure 3 A schematic structural diagram of an electronic device for implementing each embodiment of the present invention is shown in Figure 3 As shown. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and a memory 302. One or more application programs or data may be stored in the memory 302. Among them, the memory 302 may be a transient storage or a persistent storage. The application programs stored in the memory 302 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. Further, the processor 301 may be configured to communicate with the memory 302 and execute a series of computer-executable instructions in the memory 302 on the electronic device. The electronic device may further include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input / output interfaces 305, and one or more keyboards 306.
[0065] In this embodiment, the electronic device includes a processor, a communication interface, a memory, and a communication bus; among them, the processor, the communication interface, and the memory complete mutual communication through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored on the memory to implement the steps described in the above method embodiments.
[0066] It should be noted that the electronic device provided by the embodiments of this application and the log file download method provided by the embodiments of this application are based on the same inventive concept and have the same technical effects. Therefore, the specific implementation of this embodiment can refer to the implementation of the foregoing log file download method, and repeated parts are not described again.
[0067] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps described in the foregoing method embodiment are implemented.
[0068] It should be noted that the computer-readable storage medium provided by the embodiment of the present application and the log file download method provided by the embodiment of the present application are based on the same inventive concept and have the same technical effects. Therefore, the specific implementation of this embodiment can refer to the implementation of the foregoing log file download method, and the repeated parts will not be described again.
[0069] In a specific embodiment, the embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the steps described in the foregoing method embodiment.
[0070] It should be noted that the chip provided by the embodiment of the present application and the log file download method provided by the embodiment of the present application are based on the same inventive concept and have the same technical effects. Therefore, the specific implementation of this embodiment can refer to the implementation of the foregoing log file download method, and the repeated parts will not be described again.
[0071] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, an apparatus, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can 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.) that contain computer-usable program code.
[0072] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0073] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction means that implements the function specified in one or more of the procedures Figure 1 one or more procedures and / or blocks Figure 1 one or more blocks specified in the block.
[0074] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the function specified in one or more of the procedures Figure 1 one or more procedures and / or blocks Figure 1 one or more blocks specified in the block.
[0075] In a typical configuration, an electronic device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0076] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
[0077] Computer-readable media includes permanent and non-permanent, removable and non-removable media implemented by any method or technology for information storage. The 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (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 accessible by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0078] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.
[0079] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, apparatus or computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can 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 above are only the embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A method for downloading a log file, characterized in that, The described log file download method includes: Obtaining a domain name list of at least one target object from a pre-configured target interface, where the target interface is a unified interface configured for different target objects, and the domain name list of one target object includes different domain names configured for different services of one target object, and different services generate different log files; Obtaining log file download description information provided by the target object corresponding to the domain name according to the domain name in the domain name list, where the log file download description information indicates the log information of the log file generated by the service corresponding to the domain name, and the domain names in the domain name list corresponding to the target object provide log file download description information of log files generated by different services; Adding the log file download description information to the download queue corresponding to the target object, where a download queue is provided for each target object; Taking out the log file download description information from the download queue; Downloading the log file corresponding to the domain name according to the indication of the log file download description information; Wherein, for each log file download description information added to the download queue, a uniquely corresponding first identification code is configured for the one log file download description information, and the adding the log file download description information to the download queue corresponding to the target object includes: when there is no first identification code corresponding to the log file download description information in the download queue, adding the log file download description information to the download queue.
2. The log file download method according to claim 1, wherein Wherein, The log file download description information includes a log file download address, a log file size, a log file name, and log file verification information.
3. The log file downloading method according to claim 2, wherein The log file download description information and the first identification code are in the form of a key-value pair.
4. The log file downloading method according to claim 3, wherein When the log file download description information corresponding to the first identification code changes, updating the log file download description information corresponding to the first identification code to new log file download description information, and the new log file download description information corresponds to the first identification code.
5. The log file downloading method according to claim 2, wherein The downloading the log file corresponding to the domain name according to the indication of the log file download description information includes: Downloading the log file to the target file system according to the indication of the log file download description information; Wherein, when downloading the log file, a uniquely corresponding second identification code is configured for the log file.
6. The log file downloading method according to claim 1, wherein After the downloading the log file corresponding to the domain name according to the indication of the log file download description information, the method further includes: Obtaining the downloaded log file; Comparing the downloaded log file with the log file download description information to obtain download information, where the download information indicates whether the log information of the downloaded log file is consistent with the log information indicated by the log file download description information; Storing the download information in the target database.
7. The log file download method according to claim 6, characterized in that, After the storing the download information in the target database, the method further includes: Obtaining the download information from the target database; Issuing an alarm for the abnormal information in the download information.
8. A log file download device, characterized in that, The log file download device includes: An acquisition module, configured to acquire a domain name list of at least one target object from a pre-configured target interface, where the target interface is a unified interface configured for different target objects, and the domain name list of one target object includes different domain names configured for different service information of one target object; A download module, configured to acquire log file download description information provided by a target object corresponding to the domain name according to the domain name in the domain name list, where the log file download description information indicates log information of a log file generated by a service corresponding to the domain name, and the domain names in the domain name list corresponding to the target object provide log file download description information of log files generated by different services; Add the log file download description information to a download queue corresponding to the target object, where a download queue is provided for each target object; Take out the log file download description information from the download queue; Download a log file corresponding to the domain name according to the indication of the log file download description information; The download module is further configured to, for each log file download description information added to the download queue, configure a uniquely corresponding first identification code for the one log file download description information; when there is no first identification code corresponding to the log file download description information in the download queue, add the log file download description information to the download queue.
9. An electronic device, comprising a processor, a communication interface, a memory, and a communication bus; wherein, The processor, the communication interface, and the memory complete communication with each other through a bus; the memory is used to store a computer program; the processor is used to execute the program stored on the memory to implement the steps of the log file download method according to any one of claims 1-7.
Citation Information
Patent Citations
Log collection method based on ETL tool
CN106294732A
OLAP storage query system capable of efficiently fusing CDN real-time logs and storage query method of OLAP storage query system
CN112667590A