Code detection method and device for CDN scene, equipment and storage medium

By comparing the response results of the first version code and the second version code to online request traffic, the problem of low code detection accuracy in the prior art is solved, and the timely discovery and resolution of potential problems and code defects is achieved.

CN119862119APending Publication Date: 2025-04-22BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411896119.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing technology cannot perfectly reproduce the complexity and diversity of real online traffic, resulting in low accuracy of code detection and the inability to completely discover all potential system problems.

Method used

By obtaining the original request sampling log, the first version code and the second version code perform request operations on the original request, the response results of the two codes are compared, and the code detection results of the second version code are determined.

Benefits of technology

By comparing the response results of different versions of code to real online traffic, it can promptly discover potential problems and code defects in the code to be issued, and improve the accuracy of code detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862119A_ABST
    Figure CN119862119A_ABST
Patent Text Reader

Abstract

The invention provides a CDN scene-oriented code detection method, device and equipment and a storage medium, and relates to the technical field of cloud computing, in particular to the technical field of CDN, content delivery networks, software testing and intelligent detection. In some embodiments of the invention, an original request sampling log is obtained; the original request sampling log is an original request for simulating real online traffic; executing request operation on the original request by adopting the second version code to obtain second request response information; executing request operation on the original request by adopting the first version code to obtain third request response information; determining a code detection result of the second version code; the code detection result of the second version code is determined by comparing the response results of the different version codes to the original request of the real online traffic, potential problems and code defects in the to-be-issued second version code are found in time, and the code detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention provides a code detection method, device, equipment, storage medium and program product for CDN scenarios, which relate to the field of cloud computing technology, specifically CDN, content distribution network, software testing, and intelligent detection. Background Art

[0002] In the prior art, new version testing and abnormal problem troubleshooting of CDN nodes often rely on offline simulation environments or limited test cases. These testing methods are usually unable to perfectly reproduce the complexity and diversity of real online traffic, so they can only be tested by simulating specific user behaviors or request patterns. For example, developers may verify the functions and performance of the new version by manually creating some common request patterns or simulating specific user scenarios. Such methods are usually used to test some known traffic characteristics, such as simple user behavior simulation, page access traffic, and static resource requests. In addition, some companies may verify the new version through "gray release" or A / B testing of a portion of online traffic, but this method still relies on partial traffic for verification, cannot thoroughly discover all potential system problems, and cannot ensure that all user requests will cover the test of the new version.

[0003] Currently, code testing cannot simulate the actual online environment, resulting in low accuracy of code detection. Summary of the invention

[0004] The present disclosure provides a code detection method, apparatus, device and storage medium for CDN scenarios.

[0005] In one aspect of the present disclosure, a code detection method for a CDN scenario is provided, comprising:

[0006] Obtain the original request sampling log; wherein the original request sampling log is a log obtained by sampling the online request traffic using the first version code, and the original request sampling log includes:

[0007] Original request and first request response information;

[0008] Using the second version code to perform a request operation on the original request to obtain second request response information; and

[0009] Using the first version code to perform a request operation on the original request to obtain third request response information, wherein the acquisition time of the first request response information is earlier than the acquisition time of the third request response information, and the acquisition time of the second request response information is the same as the acquisition time of the third request response information;

[0010] A code detection result of the second version code is determined according to the first request response information, the second request response information, and the third request response information.

[0011] In another aspect of the present disclosure, a code detection device for a CDN scenario is provided, comprising:

[0012] An acquisition module is used to acquire an original request sampling log; wherein the original request sampling log is a log obtained by sampling online request traffic using the first version code, and the original request sampling log includes: the original request and the first request response information;

[0013] A first request module, configured to perform a request operation on the original request using a second version code to obtain second request response information; and

[0014] a second request module, configured to perform a request operation on the original request using the first version code to obtain third request response information, wherein the acquisition time of the first request response information is earlier than the acquisition time of the third request response information, and the acquisition time of the second request response information is the same as the acquisition time of the third request response information;

[0015] A determination module is used to determine a code detection result of the second version code according to the first request response information, the second request response information and the third request response information.

[0016] In another aspect of the present disclosure, there is provided an electronic device, comprising:

[0017] at least one processor; and

[0018] a memory communicatively coupled to the at least one processor;

[0019] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor so that the at least one processor can perform the above method.

[0020] In another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the above method.

[0021] In another aspect of the present disclosure, a computer program product is provided, comprising a computer program / instruction, wherein the computer program / instruction implements the steps in the above method when executed by a processor.

[0022] In some embodiments of the present disclosure, an original request sampling log is obtained; wherein the original request sampling log is a log obtained by sampling online request traffic using the first version code, and the original request sampling log is an original request that simulates real online traffic; a request operation is performed on the original request using the second version code to obtain second request response information; and a request operation is performed on the original request using the first version code to obtain third request response information; a code detection result of the second version code is determined; the present disclosure determines the code detection result of the second version code by comparing the response results of different versions of code to the original request of real online traffic, so as to timely discover potential problems and code defects in the second version code to be released, thereby improving the accuracy of code detection.

[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0025] Figure 1 A flowchart of a code detection method for a CDN scenario provided in the first embodiment of the present disclosure;

[0026] Figure 2 A flowchart of a code detection method for CDN scenarios provided in the second embodiment of the present disclosure;

[0027] Figure 3 A schematic diagram of the structure of a code detection device 30 for CDN scenarios provided by an exemplary embodiment of the present disclosure;

[0028] Figure 4 A schematic block diagram of an example electronic device that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0029] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0030] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0031] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0032] In existing technologies, offline simulation environments and limited test cases can only cover certain specific usage scenarios and cannot accurately simulate abnormal traffic and complex user behaviors that may be encountered in the real world. This leads to limited and incomplete test results, and it is difficult for developers to fully understand the pressures and problems faced by new versions under high concurrency, special requests or extreme situations.

[0033] Due to the reliance on manually created test cases, certain specific attack traffic or malicious request patterns may be missed, resulting in potential security risks or performance issues being ignored. More importantly, existing testing methods cannot fully simulate large-scale traffic scenarios and cannot verify the performance of new versions under high load and high traffic conditions.

[0034] Even online traffic testing methods such as grayscale releases cannot completely eliminate risks, because they usually only cover part of the traffic and cannot fully discover and solve all problems. In some cases, grayscale releases may even cause problems to be exposed too late, especially when certain errors only occur under specific traffic patterns. Problems may only appear after large-scale online releases. At this time, the problems discovered have already affected users and often require a large cost to repair.

[0035] In response to the above-mentioned technical problems, in some embodiments of the present disclosure, an original request sampling log is obtained; wherein the original request sampling log is a log obtained by sampling online request traffic using the first version code, and the original request sampling log is an original request that simulates real online traffic; a request operation is performed on the original request using the second version code to obtain second request response information; and a request operation is performed on the original request using the first version code to obtain third request response information; a code detection result of the second version code is determined; the present disclosure determines the code detection result of the second version code by comparing the response results of different versions of code to the original request of real online traffic, so as to timely discover potential problems and code defects in the second version code to be released, and improve the accuracy of code detection.

[0036] The technical solutions provided by various embodiments of the present disclosure are described in detail below in conjunction with the accompanying drawings.

[0037] Figure 1 The following is a flow chart of a code detection method for CDN scenarios provided in the first embodiment of the present disclosure. Figure 1 As shown, the method includes:

[0038] S101: Obtain an original request sampling log; wherein the original request sampling log is a log obtained by sampling online request traffic using the first version code, and the original request sampling log includes: the original request and the first request response information;

[0039] S102: Using the second version code to perform a request operation on the original request to obtain second request response information; and

[0040] S103: Using the first version code to perform a request operation on the original request to obtain third request response information, wherein the first request response information is obtained earlier than the third request response information, and the second request response information is obtained the same as the third request response information;

[0041] S104: Determine a code detection result of the second version code according to the first request response information, the second request response information, and the third request response information.

[0042] In this embodiment, the execution subject of the above method may be a server or a terminal device.

[0043] Among them, the terminal device includes but is not limited to a mobile station (MS), a mobile terminal, a mobile phone, a handset and a portable equipment, etc. The terminal device can communicate with one or more core networks via a radio access network (RAN). For example, the terminal device can be a mobile phone (or a "cellular" phone), a computer with a wireless communication function, etc. The terminal device can also be a computer with a wireless transceiver function, a virtual reality (VR) terminal device, an AR terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc., and the operating system installed on the terminal device includes but is not limited to: IOS, Android, windows, linux, Mac OS and other operating systems. In different networks, the terminal may be called different names, such as user equipment, mobile station, subscriber unit, station, cellular phone, personal digital assistant, wireless modem, wireless communication device, handheld device, laptop computer, cordless phone, wireless local loop station, television, etc. For the convenience of description, it is referred to as terminal equipment in this embodiment.

[0044] In this embodiment, when the execution subject of the above method is a server, the type of the server is not limited. For example, the server can be a conventional server, a cloud server, a cloud host, a virtual center, and other server devices. Among them, the composition of the server mainly includes a processor, a hard disk, a memory, a system bus, etc., and a general computer architecture type.

[0045] In this embodiment, an original request sampling log is obtained; wherein the original request sampling log is a log obtained by sampling online request traffic using the first version code, and the original request sampling log is an original request that simulates real online traffic; a request operation is performed on the original request using the second version code to obtain second request response information; and a request operation is performed on the original request using the first version code to obtain third request response information; a code detection result of the second version code is determined; the present disclosure determines the code detection result of the second version code by comparing the response results of different versions of code to the original request of real online traffic, so as to timely discover potential problems and code defects in the second version code to be released, thereby improving the accuracy of code detection.

[0046] It should be noted that the present disclosure does not limit the type of code version, and the code version in the present disclosure can be of any type. For example, it can be a CDN node version code. The full name of CDN is Content Delivery Network. The basic idea is to avoid bottlenecks and links on the Internet that may affect the speed and stability of data transmission as much as possible, so that content transmission can be faster and more stable. By placing node servers in various parts of the network to form a layer of intelligent virtual network on the basis of the existing Internet, the CDN system can redirect the user's request to the service node closest to the user in real time based on comprehensive information such as network traffic and the connection and load status of each node, as well as the distance to the user and the response time. Its purpose is to enable users to obtain the required content nearby, solve the problem of Internet network congestion, and improve the response speed of users visiting websites.

[0047] In an optional embodiment, the first version code is a stable version code that is currently online; the second version code is a version code that has been developed but not yet online, so the second version code needs to be tested to discover potential problems and code defects that may exist in the second version code.

[0048] In some embodiments of the present disclosure, the original request sampling log is obtained. The original request sampling log is a log obtained by sampling the online request traffic using the first version of the code. The original request sampling log includes: request information and request response information. The request information includes: request header information, request URL path, client IP address and target domain name; request header information, such as Referer, User-Agent, Cookie, etc. The request response information includes: response status code and response header information. These sampling logs will serve as the original data source for traffic playback, and the recorded content will reflect the request and response situations in the actual production environment as comprehensively as possible. By sampling and recording these data, the system can obtain sufficiently real request traffic and provide reliable basic data for subsequent playback tests.

[0049] For example, the CDN node stable version code is used to sample and record the domain name request to obtain the original request sampling log.

[0050] In some embodiments of the present disclosure, in order to perform effective traffic playback, three groups of playback environments need to be deployed for comparison and verification, and the three groups of playback environments are: online group, playback group and re-test group. The online group is used to store the first request response information of the original request sampling log of the sampling record. Replay group: This group deploys the latest version of the code to be released, that is, the second version of the code, which is used as a test group for traffic playback. The purpose of this group is to compare the first request response information with the online group after obtaining the second request response information to ensure that the new version can be consistent with the actual online request. Re-test group: This group maintains the online stable version of the code, that is, the first version of the code, and is used as a benchmark group; this group is used to take into account the latency of the sampling log record, and the same request response results may be different in different time periods, so that when the response information of the online group and the playback group is inconsistent, the response information of the playback group and the re-test group are compared to ensure that the function and response of the latest version of the code to be released in the current time period are consistent with the function and response of the old version of the code. Among them, the playback group and the re-test group are both online stable versions of the code, representing the response content of the current time period.

[0051] It should be noted that the first request response information corresponding to the online group is a response record from some time ago, while the acquisition time of the second request response information corresponding to the playback group and the third request response information corresponding to the re-test group is the same. Due to the difference in the acquisition time of the first request response information and the second request response information, the response results may be different. Therefore, in the case of inconsistency between the online group and the playback group, the playback group and the re-test group, both of which use the second version of the code, are compared again to further improve the accuracy of the code detection results. The same acquisition time of the second request response information and the third request response information here means that the acquisition time of the two request response information is almost the same, and it is not interpreted as the acquisition time of the two request response information being completely consistent.

[0052] In some embodiments of the present disclosure, the second version code is used to perform a request operation on the original request to obtain second request response information as a playback group, wherein the original request in the original request sampling log is input into the playback program corresponding to the second version code to perform the playback operation to obtain the second request response information.

[0053] In some embodiments of the present disclosure, the first version code is used to perform a request operation on the original request to obtain third request response information as a re-test group, wherein the original request in the original request sampling log is input into the playback program corresponding to the first version code to perform a playback operation to obtain the third request response information.

[0054] In some embodiments of the present disclosure, the first request response information and the second request response information are compared to obtain a first comparison result; if the first comparison result is inconsistent, the second request response information and the third request response information are compared to obtain a second comparison result; according to the second comparison result, the code detection result of the second version code is determined. If the first comparison result is consistent, the code detection result of the second version code is determined to be code detection passed.

[0055] In the disclosed embodiment, before performing traffic playback, it is necessary to formulate comparison indicators for traffic playback to ensure the performance comparison between the new version code and the stable version code. The main comparison indicators include comparison of response status codes and specific response header information. For example, it will verify whether the response status code of the request is consistent; the response status code, such as 200, 404, etc., and whether the specific response header information meets expectations, such as Cache-Control, Content-Type, etc. These comparison indicators will help developers quickly discover the differences between the new version code and the stable version code, and further determine whether there are potential problems introduced by the new version.

[0056] It should be noted that the first request response information includes: a first response status code and a first response header information, the second request response information includes: a second response status code and a second response header information; the third request response information includes: a third response status code and a third response header information.

[0057] In an optional embodiment, the first request response information is compared with the second request response information to obtain a first comparison result. An achievable manner is to compare the first response status code with the second response status code to obtain a third comparison result, and to compare the first response header information with the second response header information to obtain a fourth comparison result; if the third comparison result and the fourth comparison result are both consistent, the first comparison result is determined to be consistent; if there is an inconsistency between the third comparison result and the fourth comparison result, the first comparison result is determined to be inconsistent.

[0058] In an optional embodiment, the second request response information is compared with the third request response information to obtain a second comparison result. An achievable manner is to compare the second response status code with the third response status code to obtain a fifth comparison result, and to compare the second response header information with the third response header information to obtain a sixth comparison result; if the fifth comparison result and the sixth comparison result are both consistent, the second comparison result is determined to be consistent; if there is an inconsistency between the fifth comparison result and the sixth comparison result, the second comparison result is determined to be inconsistent.

[0059] In an exemplary embodiment, the original request in the original request sampling log is input into the playback program to obtain the second request response information of the playback group and the third request response information of the recheck group. The first request response information of the online group is compared with the second request response information of the playback group. If the first comparison result is consistent, the code detection result of the second version of the code is determined to be passed. If the first comparison result is inconsistent, the second request response information of the playback group and the third request response information of the recheck group are compared to obtain the second comparison result, so as to solve the inconsistent response problem caused by the latency of the sampling log or other factors. If the second comparison result is consistent, the code detection result of the second version of the code is determined to be passed; if the second comparison result is inconsistent, the code detection result of the second version of the code is determined to be failed. The playback process ensures that the functional performance of the new version is consistent with the online stable version by comparing the response status code and the response header information, and timely discovers potential errors and code defects.

[0060] In some embodiments of the present disclosure, after determining the code detection result of the second version of the code according to the second comparison result, the code detection result is uploaded to the management terminal for viewing the code detection result through the management terminal. After the traffic playback is completed, the code detection result is reported regularly, and a playback report is generated based on the code detection result and detailed difference information is provided to the development team. If a version difference is found during the playback process, the developer is promptly notified to intervene to determine whether it is caused by a code defect or error in the new version.

[0061] Figure 2 The following is a flow chart of a code detection method for CDN scenarios provided in the second embodiment of the present disclosure. Figure 2 As shown, the method includes:

[0062] S201: Obtaining an original request sampling log; wherein the original request sampling log is a log obtained by sampling online request traffic using a stable version code of a CDN node, and the original request sampling log includes: the original request and the first request response information;

[0063] S202: Using the version code to be released by the CDN node to perform a request operation on the original request to obtain second request response information; and

[0064] S203: Using the CDN node stable version code to perform a request operation on the original request to obtain third request response information, wherein the first request response information is obtained earlier than the third request response information, and the second request response information is obtained the same as the third request response information;

[0065] S204: Determine a code detection result of the version code to be released by the CDN node according to the first request response information, the second request response information and the third request response information.

[0066] In this embodiment, the implementation of the above method can refer to the corresponding parts of the above embodiments, which will not be repeated here.

[0067] In the above method embodiment of the present disclosure, an original request sampling log is obtained; wherein the original request sampling log is a log obtained by sampling online request traffic using the first version code, and the original request sampling log is an original request that simulates real online traffic; a request operation is performed on the original request using the second version code to obtain second request response information; and a request operation is performed on the original request using the first version code to obtain third request response information; a code detection result of the second version code is determined; the present disclosure determines the code detection result of the second version code by comparing the response results of different versions of code to the original request of real online traffic, so as to timely discover potential problems and code defects in the second version code to be released, thereby improving the accuracy of code detection.

[0068] Figure 3 The present invention provides a schematic diagram of a CDN scenario-oriented code detection device 30 according to an exemplary embodiment of the present invention. The CDN scenario-oriented code detection device 30 includes an acquisition module 31, a first request module 32, a second request module 33 and a determination module 34.

[0069] The acquisition module 31 is used to acquire the original request sampling log; wherein the original request sampling log is a log obtained by sampling the online request traffic using the first version code, and the original request sampling log includes: the original request and the first request response information;

[0070] A first request module 32, configured to perform a request operation on the original request using the second version code to obtain second request response information; and

[0071] A second request module 33 is used to perform a request operation on the original request using the first version code to obtain third request response information, wherein the acquisition time of the first request response information is earlier than the acquisition time of the third request response information, and the acquisition time of the second request response information is the same as the acquisition time of the third request response information;

[0072] The determination module 34 is used to determine the code detection result of the second version code according to the first request response information, the second request response information and the third request response information.

[0073] Optionally, when determining the code detection result of the second version code according to the first request response information, the second request response information and the third request response information, the determination module 34 is used to:

[0074] Compare the first request response information and the second request response information to obtain a first comparison result;

[0075] If the first comparison result is inconsistent, the second request response information and the third request response information are compared to obtain a second comparison result;

[0076] According to the second comparison result, a code detection result of the second version code is determined.

[0077] Optionally, the determination module 34 may also be used to:

[0078] When the first comparison result is consistent, it is determined that the code detection result of the second version code is that the code detection passes.

[0079] Optionally, the first request response information includes: a first response status code and first response header information, and the second request response information includes: a second response status code and second response header information; when the determination module 34 compares the first request response information and the second request response information to obtain a first comparison result, it is used to:

[0080] Compare the first response status code and the second response status code to obtain a third comparison result, and

[0081] Compare the first response header information and the second response header information to obtain a fourth comparison result;

[0082] When the third comparison result and the fourth comparison result are both consistent, the first comparison result is determined to be consistent;

[0083] When there is inconsistency between the third comparison result and the fourth comparison result, the first comparison result is determined to be inconsistent.

[0084] Optionally, the second request response information includes: a second response status code and second response header information, and the third request response information includes: a third response status code and third response header information; when the determination module 34 compares the second request response information with the third request response information to obtain a second comparison result, it is used to:

[0085] Compare the second response status code with the third response status code to obtain a fifth comparison result, and

[0086] Compare the second response header information with the third response header information to obtain a sixth comparison result;

[0087] When the fifth comparison result and the sixth comparison result are both consistent, the second comparison result is determined to be consistent;

[0088] In the case where there is inconsistency between the fifth comparison result and the sixth comparison result, the second comparison result is determined to be inconsistent.

[0089] Optionally, when determining the code detection result of the second version code according to the second comparison result, the determination module 34 is used to:

[0090] If the second comparison result is consistent, the code detection result of the second version code is determined to be code detection passed;

[0091] When the second comparison result is inconsistent, it is determined that the code detection result of the second version code is that the code detection fails.

[0092] Optionally, after determining the code detection result of the second version code according to the second comparison result, the determination module 34 may also be used to:

[0093] The code detection results are uploaded to the management terminal so that the code detection results can be viewed through the management terminal.

[0094] Regarding the device in the above embodiment, the specific way in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here. At the same time, the text processing device disclosed in the present invention can also achieve the corresponding beneficial effects of the above text processing method.

[0095] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0096] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0097] like Figure 4As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0098] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0099] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as the above method. For example, in some embodiments, the above method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the above method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the above method in any other appropriate manner (e.g., by means of firmware).

[0100] In the above-mentioned apparatus, device, storage medium and computer program product embodiments of the present disclosure, an original request sampling log is obtained; wherein the original request sampling log is a log obtained by sampling online request traffic using the first version code, and the original request sampling log is an original request simulating real online traffic; a request operation is performed on the original request using the second version code to obtain second request response information; and a request operation is performed on the original request using the first version code to obtain third request response information; a code detection result of the second version code is determined; the present disclosure determines the code detection result of the second version code by comparing the response results of the original request of different versions of code to real online traffic, so as to timely discover potential problems and code defects in the second version code to be released, thereby improving the accuracy of code detection.

[0101] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0102] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0103] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0104] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0105] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by 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, and a blockchain network.

[0106] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0107] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0108] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A code detection method for CDN scenarios, comprising: Obtaining an original request sampling log; wherein the original request sampling log is a log obtained by sampling online request traffic using the first version code, and the original request sampling log includes: the original request and the first request response information; Using the second version code to perform a request operation on the original request to obtain second request response information; and Using the first version code to perform a request operation on the original request to obtain third request response information, wherein the acquisition time of the first request response information is earlier than the acquisition time of the third request response information, and the acquisition time of the second request response information is the same as the acquisition time of the third request response information; A code detection result of the second version code is determined according to the first request response information, the second request response information, and the third request response information.

2. The method according to claim 1, wherein: The determining, according to the first request response information, the second request response information, and the third request response information, a code detection result of the second version code includes: Comparing the first request response information with the second request response information to obtain a first comparison result; If the first comparison result is inconsistent, the second request response information and the third request response information are compared to obtain a second comparison result; A code detection result of the second version code is determined according to the second comparison result.

3. The method according to claim 2, wherein: The method further comprises: When the first comparison result is consistent, the code detection result of the second version code is determined to be code detection passed.

4. The method according to claim 2, wherein: The first request response information includes: a first response status code and first response header information, and the second request response information includes: a second response status code and second response header information; the first request response information and the second request response information are compared to obtain a first comparison result, including: Compare the first response status code with the second response status code to obtain a third comparison result, and Compare the first response header information with the second response header information to obtain a fourth comparison result; When the third comparison result and the fourth comparison result are both consistent, determining that the first comparison result is consistent; In the case where there is inconsistency between the third comparison result and the fourth comparison result, it is determined that the first comparison result is inconsistent.

5. The method according to claim 2, wherein: The second request response information includes: a second response status code and a second response header information, and the third request response information includes: a third response status code and a third response header information; and the second request response information and the third request response information are compared to obtain a second comparison result, including: Compare the second response status code with the third response status code to obtain a fifth comparison result, and Compare the second response header information with the third response header information to obtain a sixth comparison result; When the fifth comparison result and the sixth comparison result are both consistent, determining that the second comparison result is consistent; In the case where there is inconsistency between the fifth comparison result and the sixth comparison result, it is determined that the second comparison result is inconsistent.

6. The method according to claim 2, wherein: Determining a code detection result of the second version code according to the second comparison result includes: If the second comparison result is consistent, determining the code detection result of the second version code is that the code detection passes; When the second comparison result is inconsistent, it is determined that the code detection result of the second version code is code detection failure.

7. The method according to claim 1, wherein: After determining the code detection result of the second version code according to the second comparison result, the method further includes: The code detection result is uploaded to the management terminal so that the code detection result can be viewed through the management terminal.

8. A code detection device for CDN scenarios, comprising: An acquisition module is used to acquire an original request sampling log; wherein the original request sampling log is a log obtained by sampling online request traffic using the first version code, and the original request sampling log includes: the original request and the first request response information; A first request module, configured to perform a request operation on the original request using a second version code to obtain second request response information; and a second request module, configured to perform a request operation on the original request using the first version code to obtain third request response information, wherein the acquisition time of the first request response information is earlier than the acquisition time of the third request response information, and the acquisition time of the second request response information is the same as the acquisition time of the third request response information; A determination module is used to determine a code detection result of the second version code according to the first request response information, the second request response information and the third request response information.

9. The device according to claim 8, wherein: When the determination module determines the code detection result of the second version code according to the first request response information, the second request response information, and the third request response information, it is used to: Comparing the first request response information with the second request response information to obtain a first comparison result; If the first comparison result is inconsistent, the second request response information and the third request response information are compared to obtain a second comparison result; A code detection result of the second version code is determined according to the second comparison result.

10. The device according to claim 9, wherein: The determination module may also be used to: When the first comparison result is consistent, the code detection result of the second version code is determined to be code detection passed.

11. The device according to claim 9, wherein: The first request response information includes: a first response status code and first response header information, and the second request response information includes: a second response status code and second response header information; when the determination module compares the first request response information and the second request response information to obtain a first comparison result, it is used to: Compare the first response status code with the second response status code to obtain a third comparison result, and Compare the first response header information with the second response header information to obtain a fourth comparison result; When the third comparison result and the fourth comparison result are both consistent, determining that the first comparison result is consistent; In the case where there is inconsistency between the third comparison result and the fourth comparison result, it is determined that the first comparison result is inconsistent.

12. The device according to claim 9, wherein: The second request response information includes: a second response status code and a second response header information, and the third request response information includes: a third response status code and a third response header information; when the determination module compares the second request response information with the third request response information to obtain a second comparison result, it is used to: Compare the second response status code with the third response status code to obtain a fifth comparison result, and Compare the second response header information with the third response header information to obtain a sixth comparison result; When the fifth comparison result and the sixth comparison result are both consistent, determining that the second comparison result is consistent; In the case where there is inconsistency between the fifth comparison result and the sixth comparison result, it is determined that the second comparison result is inconsistent.

13. The device according to claim 9, wherein: When determining the code detection result of the second version code according to the second comparison result, the determination module is used to: If the second comparison result is consistent, determining the code detection result of the second version code is that the code detection passes; When the second comparison result is inconsistent, it is determined that the code detection result of the second version code is code detection failure.

14. The device according to claim 8, wherein: After determining the code detection result of the second version code according to the second comparison result, the determination module may further be used to: The code detection result is uploaded to the management terminal so that the code detection result can be viewed through the management terminal.

15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

17. A computer program product, comprising a computer program / instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.