CN117997727A - Log landing method and device for CDN, medium and electronic equipment - Google Patents

Log landing method and device for CDN, medium and electronic equipment Download PDF

Info

Publication number
CN117997727A
CN117997727A CN202410115507.5A CN202410115507A CN117997727A CN 117997727 A CN117997727 A CN 117997727A CN 202410115507 A CN202410115507 A CN 202410115507A CN 117997727 A CN117997727 A CN 117997727A
Authority
CN
China
Prior art keywords
cdn
log
log information
information
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410115507.5A
Other languages
Chinese (zh)
Inventor
王庆
王剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Volcano Engine Technology Co Ltd
Original Assignee
Beijing Volcano Engine Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Volcano Engine Technology Co Ltd filed Critical Beijing Volcano Engine Technology Co Ltd
Priority to CN202410115507.5A priority Critical patent/CN117997727A/en
Publication of CN117997727A publication Critical patent/CN117997727A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The disclosure relates to a log landing method, a device, a medium and electronic equipment for a CDN, belongs to the technical field of computers, and can ensure high-performance log landing without affecting data throughput and performance of a system generating logs. A log landing method for a CDN, comprising: transmitting log information generated by the system operation applied to the CDN to a preset buffer area, wherein the preset buffer area is decoupled from the system applied to the CDN; reading the log information from the predetermined buffer; and writing the read log information to a disk.

Description

Log landing method and device for CDN, medium and electronic equipment
Technical Field
The disclosure relates to the technical field of computers, in particular to a log landing method, a device, a medium and electronic equipment for a CDN.
Background
The content delivery network (Content Delivery Network, CDN) is a distributed network built on the existing network for accelerating the network access speed, and relies on server groups deployed on edge nodes around the world to share the pressure of a source site server cluster by the CDN server cluster through the functions of load balancing, content delivery, content management and content storage, so that a user can obtain cached access resources nearby, avoid network congestion, and accelerate the access speed.
A commonly used transport layer protocol for Domain name systems (Domain NAME SYSTEM, DNS) applied to CDNs is the user datagram protocol (User Datagram Protocol, UDP). UDP servers are vulnerable, so the data plane DNS service software of DNS systems typically needs to be high performance software. Common high performance software is, for example, a data plane Development Kit (DATA PLANE Development Kit, DPDK) and a fast data path (eXpress Data Path, XDP). These high-performance software can typically achieve a throughput of 1 million Queries Per Second (QPS) for the UDP DNS system. Thus, the high-performance data surface system can resist the UDP traffic attack.
DNS log systems are systems that require logging of DNS requests, and typically require logging of requests and response information of DNS systems on disk for problem location and data analysis purposes. DNS log systems often cannot match the throughput of DNS systems due to performance limitations of disk Input/Output (I/O) interfaces. Once the DNS log system is opened, it may cause a decrease in the throughput of the DNS system.
Disclosure of Invention
This section is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This section is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a log-drop method for a CDN, including: transmitting log information generated by the system operation applied to the CDN to a preset buffer area, wherein the preset buffer area is decoupled from the system applied to the CDN; reading the log information from the predetermined buffer; and writing the read log information to a disk.
In a second aspect, the present disclosure provides a log landing device for a CDN, including a transmission module, a predetermined buffer, and a log landing module, wherein: the transmission module is configured to transmit log information generated by a system operation applied to a CDN to the predetermined buffer, where the predetermined buffer is decoupled from the system applied to the CDN; the predetermined buffer area is used for buffering the transmitted log information; and the log landing module is used for reading the log information from the preset buffer area and writing the read log information into a disk.
In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing device, implements the steps of the log landing method for a CDN as set forth in any one of the first aspects.
In a fourth aspect, the present disclosure provides an electronic device comprising: a storage device having at least one computer program stored thereon; at least one processing means for executing the at least one computer program in the storage means to implement the steps of the log-drop method for CDN as recited in any one of the first aspects.
By adopting the technical scheme, the log information generated by the system operation applied to the CDN can be transmitted to the preset buffer area decoupled from the system applied to the CDN, the log information is read from the preset buffer area, and the read log information is written into the disk, so that the execution of the system applied to the CDN generating the log information and the landing operation of the generated log information can be decoupled, namely, the landing operation of the generated log information can not influence the execution process of the system applied to the CDN generating the log information, and therefore, the log landing operation can not block the execution process of the system applied to the CDN generating the log information, and the data throughput (such as the query rate per second) and the performance (namely, the main processing flow of the system applied to the CDN generating the log information is unchanged) of the system applied to the CDN generating the log information, and the high-performance log landing is ensured.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale. In the drawings:
Fig. 1 is a flow chart of a log-drop method for a CDN according to one embodiment of the present disclosure.
Fig. 2 is a flow chart of yet another log-drop method for a CDN according to one embodiment of the present disclosure.
FIG. 3 is a flow chart of a method of writing cached log information to disk together when the cached log information meets a preset write condition, according to one embodiment of the present disclosure.
Fig. 4 is a schematic block diagram of a log-drop device for a CDN according to one embodiment of the present disclosure.
Fig. 5 shows a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
All actions in this disclosure to obtain signals, information or data are performed in compliance with the corresponding data protection legislation policies of the country of location and to obtain authorization granted by the owner of the corresponding device.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
For example, in response to receiving an active request from a user, a prompt is sent to the user to explicitly prompt the user that the operation it is requesting to perform will require personal information to be obtained and used with the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server or a storage medium for executing the operation of the technical scheme of the present disclosure according to the prompt information.
As an alternative but non-limiting implementation, in response to receiving an active request from a user, the manner in which the prompt information is sent to the user may be, for example, a popup, in which the prompt information may be presented in a text manner. In addition, a selection control for the user to select to provide personal information to the electronic device in a 'consent' or 'disagreement' manner can be carried in the popup window.
It will be appreciated that the above-described notification and user authorization process is merely illustrative and not limiting of the implementations of the present disclosure, and that other ways of satisfying relevant legal regulations may be applied to the implementations of the present disclosure.
Meanwhile, it can be understood that the data (including but not limited to the data itself, the acquisition or the use of the data) related to the technical scheme should conform to the requirements of the corresponding laws and regulations and related regulations.
Fig. 1 is a flow chart of a log-drop method for a CDN according to one embodiment of the present disclosure. The log landing method for the CDN is suitable for landing log information generated by various systems applied to the CDN (namely, storing the log information into a disk), for example, landing log information generated by a DNS system applied to the CDN.
As shown in fig. 1, the log-drop method for a CDN according to an embodiment of the present disclosure may include the following steps S11 to S13.
In step S11, log information generated by the system operation applied to the CDN is transmitted to a predetermined buffer, where the predetermined buffer is decoupled from the system applied to the CDN.
The log information refers to log information generated by a system in which a log needs to be recorded. Taking a DNS system applied to the CDN as an example, the log information may be log information generated by the DNS system at runtime.
A system applied to a CDN means that the system may be an integral part of the CDN, or the system may not be an integral part of the CDN, but may be used to provide bypass services (e.g., traffic scheduling, etc.) to the CDN. Taking a DNS system as an example, the DNS system may be a component of the CDN, or the DNS system may not be a component of the CDN, but may provide domain name scheduling for the CDN as a bypass service for the CDN.
Decoupling means that the predefined buffer and the CDN-applied system may be located in different physical locations, or that the predefined buffer and the CDN-applied system are located in the same physical location, but are shared memory.
Further, the predetermined buffer may be a buffer located at an arbitrary physical location.
The log information may be multithreaded to a predetermined buffer.
In addition, the log information may be asynchronously transferred to the predetermined buffer. That is, the transmission of the log information to the predetermined buffer area belongs to asynchronous non-blocking operation, and after the log information is transmitted, the system applied to the CDN immediately enters a flow of processing other packets.
In some embodiments, the transfer of log information generated by the system operation applied to the CDN to the predetermined buffer may be implemented as follows. First, the log information is encoded using a buffer protocol, and then the encoded log information is transferred to a predetermined buffer, for example, the encoded log information may be transferred to the predetermined buffer in a multithreaded manner. By encoding log information using a buffer protocol, structured data can be serialized and language and platform independent. The encoded log information can be quickly transferred to the predetermined buffer by transferring the encoded log information to the predetermined buffer in a multithreaded manner.
In some embodiments, transferring log information generated by system operation applied to the CDN to a predetermined buffer may include: the log information is transferred to the predetermined buffer in the form of a lock-free queue, for example, the previously mentioned encoded log information is transferred to the predetermined buffer in the form of a lock-free queue, and can be transferred multithreaded. Taking a DNS system as an example of a system applied to a CDN, the DNS system generally adopts multithreading high-performance software to perform data processing, so that the DNS system is a multi-producer and multi-consumer system as a whole, and therefore, log information generated by the DNS system is transmitted to a predetermined buffer area in a lock-free queue manner, so that transmission efficiency can be improved.
In step S12, the log information is read from the predetermined buffer.
In some embodiments, the log information stored in the predetermined buffer area can be read from the predetermined buffer area in a multithreading manner, so that the reading speed of the log information can be increased, the log information can be rapidly landed, and the landing efficiency and landing performance are improved.
In step S13, the read log information is written in the disk.
By adopting the technical scheme, the log information generated by the system operation applied to the CDN can be transmitted to the preset buffer area decoupled from the system applied to the CDN for generating the log information, the log information is read from the preset buffer area, and the read log information is written into the disk, so that the execution process of the system applied to the CDN for generating the log information and the landing process of the generated log information can be decoupled, namely, the landing operation of the generated log information does not influence the execution process of the system applied to the CDN for generating the log information, and therefore, the log landing operation does not block the execution process of the system applied to the CDN for generating the log information, namely, the data throughput (such as query rate per second) and the performance (namely, the main processing flow of the system applied to the CDN is unchanged) of the system itself of the system applied to the CDN, and high-performance log landing is ensured. Taking a DNS system as an example of a system applied to a CDN, in the related art, a DNS system with a QPS performance of 1 million is only tens of thousands of QPS due to the tiredness of the existing log-drop technology, but by adopting the log-drop method for the CDN according to the embodiments of the present disclosure, the QPS performance is not affected, and the DNS system can continue to use high-performance service frameworks such as DPDK and XDP to perform network acceleration, and the main processing flow of the DNS system itself is unchanged.
Fig. 2 is a flow chart of yet another log-drop method for a CDN according to one embodiment of the present disclosure. As shown in fig. 2, the log-drop method for the CDN may include the following steps S21 to S24.
In step S21, log information generated by the system operation applied to the CDN is transmitted to a predetermined buffer, where the predetermined buffer is decoupled from the system applied to the CDN. The implementation of the operation performed in step S21 is already described in detail in step S11 described above, and will not be described here again.
In step S22, the log information is read from the predetermined buffer. The implementation of the operation performed in step S22 is already described in detail in step S12 described above, and will not be described here again.
In step S23, the read log information is cached.
Here, the buffer in which the read log information is buffered is a different buffer from the aforementioned preset buffer.
In step S24, when the buffered log information satisfies the preset writing condition, the buffered log information is written together into the disk.
By adopting the technical scheme, the log information generated by the system operation applied to the CDN can be transmitted to the preset buffer area decoupled from the system applied to the CDN, the log information is read from the preset buffer area, the read log information is cached, and the cached log information is written into the disk together when the cached log information meets the preset writing condition, so that on one hand, the executing process of the system applied to the CDN and the disk-drop operation of the generated log information can be decoupled, that is, the disk-drop operation of the generated log information does not influence the executing process of the system applied to the CDN, so that the log-drop operation does not block the executing process of the system applied to the CDN, and the data throughput (for example, the query rate per second) and the performance (that is, the main processing flow of the system applied to the CDN) can not change), on the other hand, the information can be written into the disk in batches, and the disk-drop performance of the log information is ensured.
FIG. 3 is a flow chart of a method of writing cached log information to disk together when the cached log information meets a preset write condition, according to one embodiment of the present disclosure. As shown in fig. 3, the method may include the following steps S241 to S243.
In step S241, during a preset period, it is monitored whether the number of pieces of the buffered log information reaches a preset number.
In step S242, if the number of pieces of the log information buffered during the preset period reaches the preset number, the buffered log information is written into the disk together after the number of pieces of the log information buffered reaches the preset number.
For example, the preset number of pieces may be N, and if the number of pieces of the buffered log information reaches N during the preset period, that is, at any time within the preset period, the N pieces of the buffered log information are combined and written together in the disk, regardless of whether the preset period expires. That is, as long as the number of the buffered log information reaches the preset number, the buffered log information of the preset number is written together in the disk even if the preset period has not expired, and it is not necessary to wait for the expiration of the preset period to write.
In step S243, if the number of the log information buffered does not reach the preset number when the preset period expires, the buffered log information is written together into the disk when the preset period expires.
In some scenarios, the amount of log information generated may be very small, if in this case, writing is still performed when the buffered log information reaches the preset number of log information, then log information cannot be landed in time, and by the technical solution according to the embodiments of the present disclosure, the landing of log information can be triggered regularly, that is, even if the amount of log information actually generated is small, if the time of regular log landing is up, log landing still can be performed, so that the generated log information can be ensured to be landed in time.
According to the technical scheme, batch landing of log information can be realized, landing performance is improved, and timely landing of log information can be ensured under the condition that the actually generated log information quantity is small.
In some embodiments, the log information is log information generated by a domain name system applied to the CDN. Then, before transmitting log information generated by system operation applied to the CDN to a predetermined buffer, the log landing method for the CDN according to the embodiment of the present disclosure may further include: determining the current stage of the domain name system; extracting information required to be recorded in a log form at the current stage of the domain name system; the extracted information is filled in the log information in a predetermined format.
The predetermined format may be any predefined log information storage format. For example, one exemplary preset format is as follows:
message Message{
required SocketFamily socket_family=1;
required bytes query_address=3;
}
That is, according to the current stage of the domain name system applied to the CDN, information related to the socket_family and the query_address may be extracted and filled into log information in a preset format. In the above exemplary preset format, "1" in "socket_family=1" and "3" in "query_address=3" are related information extracted and filled in the log information according to the current stage of the domain name system applied to the CDN.
In addition, extracting the information that needs to be recorded in log form in the stage where the domain name system applied to the CDN is currently located may include at least one of the following:
If the current stage of the domain name system applied to the CDN is a DNS request stage, extracting at least one of the following as information to be recorded in a log form: a source address of the DNS request (query_address & socket_family), a request port of the DNS request (query_port), a request time of the DNS request (query_time_sec), a size of a data message requested by the DNS request (query_size), a request domain name of the DNS request (qname), a request type of the DNS request (qtype), a request classification of the DNS request (qclass), an address of a request ecs of the DNS request (Elastic Compute Service, cloud server) (ecs _address & ecs _socket_family);
If the current stage of the domain name system applied to the CDN is a query stage of the DNS request, at least one of the following is extracted as information to be recorded in a log form: query matching area (query_zone) of DNS response, client IP line information (geo_info), request matching line (line);
if the current stage of the domain name system applied to the CDN is a DNS response stage, extracting at least one of the following as information to be recorded in a log form: response status code (rcode), answer (answers).
By adopting the technical scheme, when the log is required to be recorded in the domain name system applied to the CDN, the information such as the client IP, the DNS extension protocol (Extension Mechanisms for DNS, EDNS) IP, the DNS request type, the DNS response content, the DNS query/matching line and the like can be extracted, and the extracted information is filled into the log information in a preset format to form the log information which is required to be transmitted to a preset buffer zone.
In some embodiments, the log-drop method for CDN according to the embodiments of the present disclosure may further include: determining whether the predetermined buffer is full; and discarding the newly generated log information if the predetermined buffer area is determined to be full.
By adopting the technical scheme, when the generated log information is transmitted to the preset buffer zone, under the condition that the preset buffer zone is fully written and the log information cannot be continuously transmitted to the preset buffer zone, the newly generated log information is directly discarded without waiting for the storage space of the preset buffer zone, namely without blocking the main flow of the system for generating the log information, which is applied to the CDN, so that the data throughput of the system for generating the log information (such as the DNS system for applying to the CDN) is ensured, and the influence of log landing on the main flow service of the system for generating the log information, which is applied to the CDN, is avoided.
Fig. 4 is a schematic block diagram of a log-drop device for a CDN according to one embodiment of the present disclosure. As shown in fig. 4, the log-drop device for CDN according to the embodiment of the present disclosure includes a transmission module 41, a predetermined buffer 42, and a log-drop module 43, wherein: a transmission module 41, configured to transmit log information generated by a system operation applied to a CDN to a predetermined buffer 42, where the predetermined buffer 42 is decoupled from the system applied to the CDN; a predetermined buffer 42 for buffering the transmitted log information; the log landing module 43 is configured to read log information from the predetermined buffer 42, and write the read log information into a disk.
By adopting the technical scheme, the log information generated by the system operation applied to the CDN can be transmitted to the preset buffer area decoupled from the system applied to the CDN, the log information is read from the preset buffer area, and the read log information is written into the disk, so that the execution process of the system applied to the CDN generating the log information and the landing operation of the generated log information can be decoupled, namely the landing operation of the generated log information can not influence the execution process of the system applied to the CDN generating the log information, and therefore the log landing operation can not block the execution of the system applied to the CDN generating the log information, namely the data throughput (such as the query rate per second) and the performance (namely the main processing flow of the system applied to the CDN generating the log information is unchanged) of the system applied to the CDN generating the log information, and high-performance log landing is ensured.
Optionally, the transmitting module 41 transmits log information generated by the system operation applied to the CDN to a predetermined buffer, including: encoding the log information using a buffer protocol; and transmitting the encoded log information to the predetermined buffer.
Optionally, the transmitting module 41 transmits log information generated by the system operation applied to the CDN to a predetermined buffer, including: the log information is transferred to the predetermined buffer in the form of a lock-free queue.
Optionally, the log landing module 43 writes the read log information to a disk, including: caching the read log information; and when the cached log information meets the preset writing condition, writing the cached log information into the disk together. For example, a buffer is provided in the log-drop module 43, for buffering log information read from the predetermined buffer 42 by the log-drop module 43.
Optionally, when the buffered log information meets a preset writing condition, the log landing module 43 writes the buffered log information into the disk together, including:
Monitoring whether the number of the cached log information reaches a preset number or not during a preset period;
if the number of the log information cached in the preset period reaches the preset number, writing the cached log information into the disk together after the number of the log information cached in the disk reaches the preset number;
if the number of the cached log information does not reach the preset number when the preset period expires, the cached log information is written into the disk together when the preset period expires.
Optionally, the log information is log information generated by a domain name system applied to the CDN, and the log-drop device for the CDN further includes an extracting module, configured to, before the transmitting module 41 transmits the log information generated by the domain name system operation applied to the CDN to a predetermined buffer: determining the current stage of the domain name system applied to the CDN; extracting information required to be recorded in a log form at the current stage of the domain name system applied to the CDN; the extracted information is filled in the log information in a predetermined format.
Optionally, the extracting module extracts the information that needs to be recorded in log form in the current stage of the domain name system applied to the CDN by:
If the current stage of the domain name system applied to the CDN is a DNS request stage, extracting at least one of the following as information to be recorded in a log form: a source address of a DNS request, a request port of the DNS request, a request time of the DNS request, a size of a data packet requested by the DNS request, a request domain name of the DNS request, a request type of the DNS request, a request classification of the DNS request, an address of a request ecs of the DNS request;
If the current stage of the domain name system applied to the CDN is a query stage of the DNS request, at least one of the following is extracted as information to be recorded in a log form: the DNS responds to the query matching area, the client IP line information and the request matching line;
If the current stage of the domain name system applied to the CDN is a DNS response stage, extracting at least one of the following as information to be recorded in a log form: responding to the status code and the response.
Optionally, the transmission module 41 is further configured to: determining whether the predetermined buffer is full; and discarding the newly generated log information if the predetermined buffer area is determined to be full.
The specific implementation manner of the operations performed by each module in the log-drop device for CDN according to the embodiments of the present disclosure is described in detail in the log-drop method for CDN, and will not be described herein.
The present disclosure also provides a computer readable medium having stored thereon a computer program which, when executed by a processing device, implements the steps of any of the methods of the present disclosure for log landing of CDNs.
The present disclosure also provides an electronic device, including: a storage device having at least one computer program stored thereon; at least one processing means for executing at least one computer program in the storage means to implement the steps of any of the log landing method for CDN of the present disclosure.
Referring now to fig. 5, a schematic diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. When executed by the processing device 601, the computer program performs the above-described functions defined in the log-drop method for CDN of the embodiments of the present disclosure.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: transmitting log information generated by the system operation applied to the CDN to a preset buffer area, wherein the preset buffer area is decoupled from the system applied to the CDN; reading the log information from the predetermined buffer; and writing the read log information to a disk.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. The name of the module is not limited to the module itself in some cases, and for example, the transmission module may also be described as "a module for transmitting log information generated by the system operation applied to the CDN to the predetermined buffer".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In accordance with one or more embodiments of the present disclosure, example 1 provides a log-drop method for a CDN, comprising: transmitting log information generated by the system operation applied to the CDN to a preset buffer area, wherein the preset buffer area is decoupled from the system applied to the CDN; reading the log information from the predetermined buffer; and writing the read log information to a disk.
According to one or more embodiments of the present disclosure, example 2 provides a log-drop method for a CDN of example 1, wherein the transmitting log information generated by a system operation applied to the CDN to a predetermined buffer includes:
encoding the log information using a buffer protocol;
And transmitting the encoded log information to the predetermined buffer.
According to one or more embodiments of the present disclosure, example 3 provides a log-drop method for a CDN of example 1, wherein the transmitting log information generated by a system operation applied to the CDN to a predetermined buffer includes:
the log information is transferred to the predetermined buffer in the form of a lock-free queue.
According to one or more embodiments of the present disclosure, example 4 provides a log-drop method for a CDN of example 1, wherein writing the read log information to disk includes:
Caching the read log information;
And when the cached log information meets the preset writing condition, writing the cached log information into the disk together.
According to one or more embodiments of the present disclosure, example 5 provides a log-drop method for a CDN of example 4, wherein writing the cached log information together in the disk when the cached log information meets a preset writing condition includes:
Monitoring whether the number of the cached log information reaches a preset number or not during a preset period;
if the number of the log information cached in the preset period reaches the preset number, writing the cached log information into the disk together after the number of the log information cached in the disk reaches the preset number;
if the number of the cached log information does not reach the preset number when the preset period expires, the cached log information is written into the disk together when the preset period expires.
According to one or more embodiments of the present disclosure, example 6 provides a log-drop method for a CDN of example 1, wherein the log information is log information generated by a domain name system applied to the CDN, and before the log information generated by a system operation applied to the CDN is transferred to a predetermined buffer, the log-drop method for the CDN further includes:
Determining the current stage of the domain name system applied to the CDN;
extracting information required to be recorded in a log form at the current stage of the domain name system applied to the CDN;
The extracted information is filled in the log information in a predetermined format.
According to one or more embodiments of the present disclosure, example 7 provides the log-drop method for a CDN of example 6, wherein the extracting information that needs to be recorded in a log form at a stage where a domain name system applied to the CDN is currently located includes:
If the current stage of the domain name system applied to the CDN is a DNS request stage, extracting at least one of the following as information to be recorded in a log form: a source address of a DNS request, a request port of the DNS request, a request time of the DNS request, a size of a data packet requested by the DNS request, a request domain name of the DNS request, a request type of the DNS request, a request classification of the DNS request, an address of a request ecs of the DNS request;
If the current stage of the domain name system applied to the CDN is a query stage of the DNS request, at least one of the following is extracted as information to be recorded in a log form: the DNS responds to the query matching area, the client IP line information and the request matching line;
If the current stage of the domain name system applied to the CDN is a DNS response stage, extracting at least one of the following as information to be recorded in a log form: responding to the status code and the response.
According to one or more embodiments of the present disclosure, example 8 provides the log-drop method for a CDN of any one of examples 1 to 7, wherein the log-drop method for a CDN further comprises:
determining whether the predetermined buffer is full;
and discarding the newly generated log information if the predetermined buffer area is determined to be full.
Example 9 provides a log landing device for a CDN according to one or more embodiments of the present disclosure, including a transmission module, a predetermined buffer, and a log landing module, wherein:
The transmission module is configured to transmit log information generated by a system operation applied to a CDN to the predetermined buffer, where the predetermined buffer is decoupled from the system applied to the CDN;
the predetermined buffer area is used for buffering the transmitted log information;
and the log landing module is used for reading the log information from the preset buffer area and writing the read log information into a disk.
According to one or more embodiments of the present disclosure, example 10 provides the log-drop device for a CDN of example 9, wherein the transmitting module transmits log information generated by a system operation applied to the CDN to a predetermined buffer, including:
encoding the log information using a buffer protocol;
And transmitting the encoded log information to the predetermined buffer.
According to one or more embodiments of the present disclosure, example 11 provides the log-drop device for a CDN of example 9, wherein the transmitting module transmits log information generated by a system operation applied to the CDN to a predetermined buffer, including:
the log information is transferred to the predetermined buffer in the form of a lock-free queue.
Example 12 provides the log landing gear for CDN of example 9, wherein the log landing module writes the read log information to disk, comprising:
Caching the read log information;
And when the cached log information meets the preset writing condition, writing the cached log information into the disk together.
According to one or more embodiments of the present disclosure, example 13 provides the log landing device for a CDN of example 12, wherein the log landing module writes the cached log information together in the disk when the cached log information meets a preset writing condition, including:
Monitoring whether the number of the cached log information reaches a preset number or not during a preset period;
if the number of the log information cached in the preset period reaches the preset number, writing the cached log information into the disk together after the number of the log information cached in the disk reaches the preset number;
if the number of the cached log information does not reach the preset number when the preset period expires, the cached log information is written into the disk together when the preset period expires.
According to one or more embodiments of the present disclosure, example 14 provides the log-drop device for a CDN of example 9, wherein the log information is log information generated by a domain name system applied to the CDN, and further includes an extracting module, before the transmitting module transmits the log information generated by the system operation applied to the CDN to a predetermined buffer:
Determining the current stage of the domain name system applied to the CDN;
extracting information required to be recorded in a log form at the current stage of the domain name system applied to the CDN;
The extracted information is filled in the log information in a predetermined format.
According to one or more embodiments of the present disclosure, example 15 provides the log-drop device for a CDN of example 14, wherein the extracting module extracts information that needs to be logged in a log form at a stage where the domain name system applied to the CDN is currently located by:
If the current stage of the domain name system applied to the CDN is a DNS request stage, extracting at least one of the following as information to be recorded in a log form: a source address of a DNS request, a request port of the DNS request, a request time of the DNS request, a size of a data packet requested by the DNS request, a request domain name of the DNS request, a request type of the DNS request, a request classification of the DNS request, an address of a request ecs of the DNS request;
If the current stage of the domain name system applied to the CDN is a query stage of the DNS request, at least one of the following is extracted as information to be recorded in a log form: the DNS responds to the query matching area, the client IP line information and the request matching line;
If the current stage of the domain name system applied to the CDN is a DNS response stage, extracting at least one of the following as information to be recorded in a log form: responding to the status code and the response.
According to one or more embodiments of the present disclosure, example 16 provides the log landing device for a CDN of any one of examples 9 to 15, wherein the transmission module is further to:
determining whether the predetermined buffer is full;
and discarding the newly generated log information if the predetermined buffer area is determined to be full.
According to one or more embodiments of the present disclosure, example 17 provides a computer-readable medium having stored thereon a computer program which, when executed by a processing device, implements the steps of the log-drop method for a CDN of any one of examples 1-8.
Example 18 provides an electronic device, according to one or more embodiments of the present disclosure, comprising: a storage device having at least one computer program stored thereon; at least one processing means for executing the at least one computer program in the storage means to implement the steps of the log-drop method for CDN as recited in any one of examples 1-8.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims. The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.

Claims (11)

1. A log landing method for a CDN, comprising:
Transmitting log information generated by the system operation applied to the CDN to a preset buffer area, wherein the preset buffer area is decoupled from the system applied to the CDN;
reading the log information from the predetermined buffer; and
And writing the read log information into a disk.
2. The method for the drop of logs for the CDN as recited in claim 1, wherein transmitting log information generated by a system operation applied to the CDN to a predetermined buffer includes:
encoding the log information using a buffer protocol;
And transmitting the encoded log information to the predetermined buffer.
3. The method for the drop of logs for the CDN as recited in claim 1, wherein transmitting log information generated by a system operation applied to the CDN to a predetermined buffer includes:
the log information is transferred to the predetermined buffer in the form of a lock-free queue.
4. The log-drop method for CDN as recited in claim 1, wherein writing the read log information to disk comprises:
Caching the read log information;
And when the cached log information meets the preset writing condition, writing the cached log information into the disk together.
5. The method for the drop of journals for CDNs according to claim 4, wherein writing the cached journals together in the disk when the cached journals meet a preset writing condition comprises:
Monitoring whether the number of the cached log information reaches a preset number or not during a preset period;
if the number of the log information cached in the preset period reaches the preset number, writing the cached log information into the disk together after the number of the log information cached in the disk reaches the preset number;
if the number of the cached log information does not reach the preset number when the preset period expires, the cached log information is written into the disk together when the preset period expires.
6. The method for log-drop of CDN as recited in claim 1, wherein the log information is log information generated by a domain name system applied to the CDN, and before the log information generated by the system operation applied to the CDN is transferred to a predetermined buffer, the method for log-drop of CDN further comprises:
Determining the current stage of the domain name system;
extracting information required to be recorded in a log form at the current stage of the domain name system;
The extracted information is filled in the log information in a predetermined format.
7. The method for log-drop of CDN as recited in claim 6, wherein said extracting information that needs to be logged in a stage where the domain name system is currently located includes:
if the current stage of the domain name system is a DNS request stage, at least one of the following is extracted as information to be recorded in a log form: a source address of a DNS request, a request port of the DNS request, a request time of the DNS request, a size of a data packet requested by the DNS request, a request domain name of the DNS request, a request type of the DNS request, a request classification of the DNS request, an address of a request ecs of the DNS request;
If the current stage of the domain name system is the query stage of the DNS request, at least one of the following is extracted as the information to be recorded in the form of a log: the DNS responds to the query matching area, the client IP line information and the request matching line;
If the current stage of the domain name system is a DNS response stage, at least one of the following is extracted as information to be recorded in a log form: responding to the status code and the response.
8. The log-drop method for CDN as recited in any one of claims 1 to 7, wherein the log-drop method for CDN further comprises:
determining whether the predetermined buffer is full;
and discarding the newly generated log information if the predetermined buffer area is determined to be full.
9. The log landing device for the CDN is characterized by comprising a transmission module, a preset buffer area and a log landing module, wherein:
The transmission module is configured to transmit log information generated by a system operation applied to a CDN to the predetermined buffer, where the predetermined buffer is decoupled from the system applied to the CDN;
the predetermined buffer area is used for buffering the transmitted log information;
and the log landing module is used for reading the log information from the preset buffer area and writing the read log information into a disk.
10. A computer readable medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processing device, implements the steps of the log landing method for CDN as claimed in any one of claims 1 to 8.
11. An electronic device, comprising:
A storage device having at least one computer program stored thereon;
At least one processing means for executing the at least one computer program in the storage means to implement the steps of the log-drop method for CDN as recited in any one of claims 1-8.
CN202410115507.5A 2024-01-26 2024-01-26 Log landing method and device for CDN, medium and electronic equipment Pending CN117997727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410115507.5A CN117997727A (en) 2024-01-26 2024-01-26 Log landing method and device for CDN, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410115507.5A CN117997727A (en) 2024-01-26 2024-01-26 Log landing method and device for CDN, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117997727A true CN117997727A (en) 2024-05-07

Family

ID=90900951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410115507.5A Pending CN117997727A (en) 2024-01-26 2024-01-26 Log landing method and device for CDN, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117997727A (en)

Similar Documents

Publication Publication Date Title
CN110753089B (en) Method, device, medium and electronic equipment for managing client
US11089007B2 (en) Role-based resource access control
CN111221638B (en) Concurrent task scheduling processing method, device, equipment and medium
CN111246228B (en) Method, device, medium and electronic equipment for updating gift resources of live broadcast room
CN111930709B (en) Data storage method, apparatus, electronic device, and computer readable medium
CN112416632B (en) Event communication method and device, electronic equipment and computer readable medium
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN112866385A (en) Interface calling method and device, electronic equipment and storage medium
CN112702336A (en) Security control method and device for government affair service, security gateway and storage medium
CN112486825B (en) Multi-lane environment architecture system, message consumption method, device, equipment and medium
CN111858381B (en) Application fault tolerance capability test method, electronic device and medium
CN112416887B (en) Information interaction method and device and electronic equipment
CN117997727A (en) Log landing method and device for CDN, medium and electronic equipment
CN111309497B (en) Information calling method and device, server, terminal and storage medium
CN111756833B (en) Node processing method, node processing device, electronic equipment and computer readable medium
CN112804768B (en) Method and device for processing communication connection, terminal and non-transitory storage medium
CN113765692B (en) Current limiting method, device, electronic equipment and computer readable medium
CN116938598B (en) Information transmission method, apparatus, electronic device, and computer-readable medium
CN112261659B (en) Control method and device for terminal and server, terminal and storage medium
CN115225586B (en) Data packet transmitting method, device, equipment and computer readable storage medium
CN110262756B (en) Method and device for caching data
CN116756418A (en) Data pushing method, device, equipment and storage medium
CN114444064A (en) Account processing method and device, electronic equipment and computer readable medium
CN114254385A (en) Access control method, device, electronic equipment and storage medium
CN111625566A (en) Data caching method, device, medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination