Data detection method, device and equipment and computer storage medium
By combining listening components and regular expressions, the compatibility of front-end code and browser is detected, and the problem of low detection efficiency in the existing technology is solved, and fast and accurate compatibility detection is achieved.
Patent Information
- Application Number
- CN202411572465.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is inefficient when detecting the compatibility of front-end code with browsers of different versions and types, and requires manual running of codes one by one to determine compatibility.
The monitoring component detects the communication information sent by the target application, obtains the initial code data, and uses regular expressions to detect the format of the code data to determine the compatibility between the code and the browser, avoids running the code data in the browser, and reduces detection time.
Improves the efficiency of data detection, reduces detection time, and improves the speed and accuracy of code compatibility detection with browsers.
Smart Images

Figure CN119440667A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data processing, and in particular to a method, device, equipment, computer storage medium and computer program product for data detection. Background Art
[0002] Currently, after the front-end code is developed, it is usually compiled and run on the browser to determine whether the front-end code is compatible with the current browser.
[0003] However, different versions and different types of browsers need to be tested for compatibility with the front-end code. The compiled front-end code is manually run on different versions and different types of browsers to test the compatibility of the front-end code, resulting in low testing efficiency. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, apparatus, device, computer storage medium, and computer program product for data detection, which can improve the efficiency of data detection.
[0005] In a first aspect, an embodiment of the present disclosure provides a data detection method, which is applied to a target system, and the method includes:
[0006] Using the monitoring component to detect target communication information sent by the target application, the target communication information indicates that the initial code data compilation is completed;
[0007] acquiring initial code data from the target application upon detecting target communication information;
[0008] Filtering target code data corresponding to preset code data from the initial code data to obtain code data, the code data including a character string;
[0009] Get browser version information;
[0010] Obtain a regular expression corresponding to the browser version information from the target storage space;
[0011] Use regular expressions to detect the format of each character in a string;
[0012] When the format of each character of the string is consistent with the format of the screening character corresponding to the regular expression, target information is determined, and the target information indicates that the code data is incompatible with the browser.
[0013] In one practicable implementation, the target application includes a code compilation application, and using a monitoring component to detect target communication information sent by the target application includes:
[0014] The monitoring component detects the target communication information sent by the code compilation application.
[0015] In an achievable implementation, the preset code data includes JavaScript code data, and the target code data corresponding to the preset code data is screened out from the initial code data to obtain the code data, including:
[0016] According to the code data type, target code data corresponding to the JavaScript code data is screened out from the initial code data to obtain the code data.
[0017] In one possible implementation, after determining the target information, the method further includes:
[0018] A target patch file corresponding to the target information is injected into the code data.
[0019] In one practicable implementation, injecting a target patch file corresponding to the target information into the code data includes:
[0020] Obtaining an initial target patch file from the target storage space;
[0021] De-duplicate the initial target patch file to obtain the target patch file;
[0022] A target patch file corresponding to the target information is injected into the code data.
[0023] In an achievable implementation, the code data includes an entry file, and injecting a target patch file corresponding to the target information into the code data includes:
[0024] Store the target patch file in the same file area as the code data location information;
[0025] Add the reference information corresponding to the target patch file to the entry file.
[0026] In one practicable implementation, before obtaining the browser version information, the method further includes:
[0027] Determine the target browser version;
[0028] Obtain a regular expression corresponding to the target version of the browser from the technical documentation corresponding to the target version of the browser;
[0029] The regular expression corresponding to the target version of the browser is stored in the target storage space.
[0030] In a second aspect, an embodiment of the present disclosure provides a data detection device, which is applied to a target system, and the device includes:
[0031] A detection module, used for detecting target communication information sent by a target application using a monitoring component, wherein the target communication information indicates that initial code data compilation is completed;
[0032] an acquisition module, for acquiring initial code data from a target application program when target communication information is detected;
[0033] A screening module, used to screen out target code data corresponding to preset code data from the initial code data to obtain code data, wherein the code data includes a character string;
[0034] The acquisition module is also used to obtain browser version information and code data, the code data includes a string;
[0035] The acquisition module is further used to acquire the regular expression corresponding to the browser version information from the target storage space;
[0036] The detection module is also used to detect the format of each character of the string using a regular expression;
[0037] The determination module is used to determine target information when the format of each character in the string is consistent with the format of the screening character corresponding to the regular expression, and the target information represents that the code data is incompatible with the browser.
[0038] In a third aspect, an embodiment of the present disclosure provides a data detection device, the device comprising a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement a data detection method as described in any one of the first aspects.
[0039] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, a method for data detection as described in any one of the first aspects is implemented.
[0040] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which implements a data detection method as described in any one of the first aspects when the computer program is executed by a processor.
[0041] The data detection method, device, equipment, computer storage medium and computer program product provided by the embodiments of the present disclosure. The method uses a monitoring component to detect the target communication information sent by the target application. When the target communication information is detected, the initial code data is obtained from the target application. The target code data corresponding to the preset code data is filtered out from the initial code data to obtain the code data. The browser version information is obtained. The regular expression corresponding to the browser version information is obtained from the target storage space. The format of each character of the string is detected by using the regular expression. When the format of each character of the string is consistent with the format of the filtered characters corresponding to the regular expression, the target information is determined. Therefore, the present disclosure obtains the regular expression through the target storage space, and uses the regular expression to detect the format of the string of the code data, so as to avoid running the code data in the browser, reduce the detection time, and thus improve the data detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following is a brief introduction to the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 is a flow chart of a data detection method provided by an embodiment of the present disclosure;
[0044] Figure 2 is a flowchart of a method for obtaining a target patch file provided by an embodiment of the present disclosure;
[0045] Figure 3 It is a flowchart of a method for injecting a target patch file provided by an embodiment of the present disclosure;
[0046] Figure 4 It is a flowchart of a method for storing regular expressions provided by an embodiment of the present disclosure;
[0047] Figure 5 is a flow chart of another data detection method provided by an embodiment of the present disclosure;
[0048] Figure 6 is a structural schematic diagram of a data detection device provided by an embodiment of the present disclosure;
[0049] Figure 7 It is a structural diagram of a data detection device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0050] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present invention, rather than to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.
[0051] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0052] It should be noted that the acquisition, storage, use and processing of data in the embodiments of the present application are in compliance with the relevant provisions of national laws and regulations.
[0053] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0054] Before describing the technical solutions provided by the embodiments of the present disclosure, in order to facilitate understanding of the embodiments of the present disclosure, the present disclosure specifically describes the problems existing in the related technologies:
[0055] At present, after the front-end code is developed, it needs to be compiled. During the compilation process, an important process is to solve the browser compatibility of the front-end code so that the front-end code can run smoothly on most browsers. Especially when the code is required to be compatible with a specific version of the browser, the front-end code is often run on a specific version of the browser to see whether the code can run normally to determine whether the code is compatible with the browser of that version. If it is not compatible, the corresponding patch file is injected into the front-end code according to the incompatible information to solve the browser compatibility. However, the efficiency of code data compatibility detection in the above method is not high.
[0056] The embodiments of the present disclosure provide a method, apparatus, device, computer storage medium and computer program product for data detection, which can solve the technical problems existing in the related technologies.
[0057] The embodiment of the present disclosure utilizes a monitoring component to detect target communication information sent by a target application. When the target communication information is detected, initial code data is obtained from the target application. Target code data corresponding to preset code data is filtered out from the initial code data to obtain code data. Browser version information is obtained. A regular expression corresponding to the browser version information is obtained from a target storage space. The format of each character of the string is detected using a regular expression. When the format of each character of the string is consistent with the format of the filtered characters corresponding to the regular expression, the target information is determined. Therefore, the present disclosure obtains a regular expression through a target storage space, and utilizes a regular expression to detect the format of the string of code data, thereby avoiding running code data in a browser, reducing detection time, and thus improving data detection efficiency.
[0058] The following is an introduction to the data detection method provided by the embodiment of the present disclosure.
[0059] Figure 1 FIG. 1 is a flow chart of a method for data detection provided by an embodiment of the present disclosure. Figure 1 The execution subject of the method is the target system, and the method includes steps S110-S170.
[0060] S110: Using the monitoring component to detect target communication information sent by the target application.
[0061] The target system uses internal monitoring components to detect the target communication information sent by the target application.
[0062] Among them, the target communication information represents that the initial code data compilation is completed.
[0063] S120: When the target communication information is detected, initial code data is acquired from the target application.
[0064] If the monitoring component detects the target communication information, it obtains the initial code data from the target application.
[0065] S130: Filter out target code data corresponding to preset code data from the initial code data to obtain code data.
[0066] After the initial code data is acquired, target code data corresponding to the preset code data is screened out from the initial code data to obtain code data.
[0067] The code data includes a character string.
[0068] S140: Obtain browser version information.
[0069] Exploit the target system to obtain browser version information.
[0070] The browser version information represents the version information of the browser for which code compatibility needs to be detected. The browser version information includes the type version and data version of the browser.
[0071] In one embodiment, after determining the browser for which code compatibility detection is required, the target system obtains browser version information and code data for detecting code compatibility.
[0072] In one example, multiple browser version information may be obtained simultaneously.
[0073] S150: Acquire a regular expression corresponding to the browser version information from the target storage space.
[0074] Different browser version information corresponds to different regular expressions, and the regular expressions represent the code detection rules of the browser.
[0075] After obtaining the browser version information, the target system obtains the regular expression corresponding to the browser version information from the internal target storage space.
[0076] S160: Use a regular expression to detect the format of each character in the string.
[0077] After the regular expression corresponding to the browser version information is obtained, the format of each character of the string in the code data is detected according to the regular expression.
[0078] S170: When the format of each character of the character string is consistent with the screening character format corresponding to the regular expression, determine the target information.
[0079] If the format of each character of the string is consistent with the filtering character format corresponding to the regular expression, the target information is determined.
[0080] Among them, the target information represents that the code data is incompatible with the current version of the browser.
[0081] In one example, the steps of using regular expressions to detect the character format of a string are as follows: wherein the regular expression M is "\d{3}-\d{4}" where \d means matching a number (0-9). {3} means that the preceding element must appear three times. - means matching a dash. {4} means that the preceding element must appear four times. The string "123-4567" is detected using regular expression M, wherein the characters "1", "2", and "3" satisfy the \d matching rule. The three numeric characters "1", "2", and "3" appear three times in a row, satisfying the {3} matching rule. There is a character "-", which satisfies the dash matching rule. Similarly, "4567" also satisfies the matching rule. Therefore, the string "123-4567" is consistent with the filtering character format corresponding to the regular expression M.
[0082] The disclosed embodiment obtains a regular expression through a target storage space, and uses the regular expression to detect the format of a string of code data, thereby avoiding running the code data in a browser, reducing detection time, and thus improving data detection efficiency.
[0083] In one embodiment, the target application includes a code compilation application, and using a monitoring component to detect target communication information sent by the target application may include step S111.
[0084] S111: Using the monitoring component to detect the target communication information sent by the code compilation application.
[0085] Utilize the monitoring component of the target system to detect the target communication information sent by the code compilation application.
[0086] The code compilation application is a module packaging tool, and the code compilation application may include a Webpack platform.
[0087] The disclosed embodiment utilizes a monitoring component to detect the target communication information sent by a code compilation application, thereby obtaining compiled code data for subsequent code compatibility detection, avoiding manual acquisition of compiled code data, saving human resource costs, and thus improving detection efficiency.
[0088] In one embodiment, the preset code data includes JavaScript code data, and filtering out target code data corresponding to the preset code data from the initial code data to obtain the code data may include step S121.
[0089] S121: According to the code data type, target code data corresponding to the JavaScript code data is screened out from the initial code data to obtain the code data.
[0090] After the initial code data is obtained, target code data corresponding to the JavaScript code data is screened out from the initial code data according to the code data type to obtain the code data.
[0091] It should be noted that only part of the code in the code data will affect the compatibility with the browser. Therefore, the embodiment of the present disclosure obtains the code data for detecting compatibility by screening the initial code data, which can shorten the time for detecting the code data and thus improve the detection efficiency.
[0092] In one embodiment, after determining the target information, the data detection method further includes step S180.
[0093] S180: Injecting a target patch file corresponding to the target information into the code data.
[0094] After the code data is acquired, a target patch file corresponding to the target information is injected into the code data.
[0095] The target patch file represents a patch file used to repair the compatibility of the code data with the current version of the browser.
[0096] The disclosed embodiment can improve the compatibility of code data with the browser by injecting a target patch file into the code data.
[0097] In one example, the target system may include an initialization module, a detection module, and a storage module. The initialization module is used to obtain code data of the target terminal. The detection module is used to detect the compatibility of the code data with the browser. The storage module is used to store regular expressions and patch files corresponding to the browser version information.
[0098] In one embodiment, Figure 2 As shown, injecting a target patch file corresponding to the target information into the code data may include steps S181-S183.
[0099] S181: Acquire an initial target patch file from the target storage space.
[0100] After the target information is determined, an initial target patch file corresponding to the target information is obtained from the target storage space.
[0101] S182: De-duplicate the initial target patch file to obtain a target patch file.
[0102] After the initial target patch file is obtained, the initial target patch file is deduplicated according to the description information corresponding to the initial target patch file to obtain the target patch file.
[0103] The description information corresponding to the initial target patch file is used to describe how the initial target patch file modifies and corrects the code data. The description information corresponding to the initial target patch file can be obtained through the comments in the initial target patch file.
[0104] S183: Injecting a target patch file corresponding to the target information into the code data.
[0105] After obtaining the target patch file, the target patch file corresponding to the target information is injected into the code data.
[0106] In one example, the code data has compatibility issues with browser B due to syntax A, so patch file C needs to be injected into the code data. The code data has compatibility issues with browser E due to syntax D, so patch file C also needs to be injected. Since the compatibility issues of syntax A and syntax B can be solved by injecting patch file C, the initial target patch file is deduplicated to obtain the target patch file, that is, patch file C only needs to be injected once to solve the compatibility of code data and browsers.
[0107] The disclosed embodiment obtains a target patch file by deduplicating the initial target patch file, thereby avoiding the patch file from rereading the injected code data, thereby improving the security and stability of the code data.
[0108] In one embodiment, Figure 3 As shown, the code data includes an entry file, and injecting a target patch file corresponding to the target information into the code data may include steps S210-S220.
[0109] S210: Store the target patch file in the same file area as the code data location information.
[0110] After the target patch file is obtained, the target patch file is stored in the same file area as the code data location information.
[0111] In one example, after the target patch file K is obtained, the target patch file K is stored in a folder of the code data L.
[0112] S220: Add reference information corresponding to the target patch file to the entry file.
[0113] The entry file represents the file that is executed first in the code data. The reference information is used by the entry file to find the corresponding target patch file according to the storage path information.
[0114] The disclosed embodiment can improve the effectiveness of the target patch file in resolving compatibility issues of code data by storing the target patch file in a corresponding file area and adding reference information to an entry file.
[0115] In one embodiment, Figure 4 As shown, before obtaining the browser version information, the data detection method further includes steps S230-S250.
[0116] S230: Determine the target version of the browser.
[0117] Determine the target browser versions for which code compatibility testing is required.
[0118] S240: Obtain a regular expression corresponding to the target version of the browser from a technical document corresponding to the target version of the browser.
[0119] According to the determined target version of the browser, a technical document corresponding to the target version of the browser is determined, and a regular expression corresponding to the target version of the browser is obtained from the technical document corresponding to the target version of the browser.
[0120] In one example, a technical document corresponding to the version information may be downloaded from an official website corresponding to the target version of the browser, and then a regular expression corresponding to the target version of the browser may be obtained from the technical document.
[0121] S250: Storing the regular expression corresponding to the target version of the browser into the target storage space.
[0122] After the regular expression corresponding to the target version of the browser is acquired, the regular expression corresponding to the target version of the browser is stored in the target storage space.
[0123] The target storage space also stores the version information of the browser, including the browser name and version number.
[0124] The disclosed embodiment stores regular expressions corresponding to the target version of the browser in a target storage space, thereby facilitating subsequent detection of code data according to multiple regular expressions in the target storage space, thereby improving detection efficiency.
[0125] In one example, the steps of the data detection method are as follows: Figure 5As shown, wherein: in step S301, the target system is initialized and a connection is established with the Webpack platform, wherein the target system is integrated into the Webpack platform in the form of a Webpack plug-in. In step S302, the compilation completion event of the Webpack platform is listened. In step S303, after listening to the compilation completion event of the Webpack platform, the target system obtains the initial code data from the Webpack platform. In step S304, the target system filters out the code data corresponding to the JavaScript code data according to the initial code data. In step S305, the target system queries the corresponding regular expression according to the obtained browser version information. In step S306, the target system uses the regular expression to detect the format of each character of each string in the code data. In step S307, the target system determines the target information when the format of each character of the string is consistent with the filtering character format corresponding to the regular expression. In step S308, the target system obtains the corresponding target patch file from the target storage space according to the target information. In step S309, the target system injects the target patch file into the code data.
[0126] like Figure 6 As shown, the embodiment of the present disclosure further provides a data detection device 600, which is applied to a target system. The data detection device 600 includes:
[0127] A detection module 601 is used to detect target communication information sent by a target application using a monitoring component, where the target communication information indicates that initial code data compilation is completed;
[0128] The acquisition module 602 is used to acquire the initial code data from the target application program when the target communication information is detected;
[0129] A screening module 603 is used to screen out target code data corresponding to preset code data from the initial code data to obtain code data, where the code data includes a character string;
[0130] The acquisition module 602 is also used to obtain browser version information;
[0131] The acquisition module 602 is further used to acquire a regular expression corresponding to the browser version information from the target storage space;
[0132] The detection module 601 is further used to detect the format of each character of the string using a regular expression;
[0133] The determination module 604 is used to determine target information when the format of each character in the string is consistent with the format of the screening character corresponding to the regular expression, and the target information indicates that the code data is incompatible with the browser.
[0134] The disclosed embodiment obtains a regular expression through a target storage space, and uses the regular expression to detect the format of a string of code data, thereby avoiding running the code data in a browser, reducing detection time, and thus improving data detection efficiency.
[0135] In some embodiments, the detection module 601 is specifically configured to:
[0136] The monitoring component detects the target communication information sent by the code compilation application.
[0137] In some embodiments, the acquisition module 602 is specifically configured to:
[0138] According to the code data type, target code data corresponding to the JavaScript code data is screened out from the initial code data to obtain the code data.
[0139] In some embodiments, the data detection device 600 includes an injection module, and the injection module is used to inject a target patch file corresponding to the target information into the code data.
[0140] In some embodiments, the acquisition module 602 is specifically configured to:
[0141] Obtaining an initial target patch file from the target storage space;
[0142] De-duplicate the initial target patch file to obtain the target patch file;
[0143] A target patch file corresponding to the target information is injected into the code data.
[0144] In some embodiments, the data detection apparatus 600 includes a storage module, and the storage module is used to store the target patch file in a file area that is the same as the code data location information;
[0145] Add the reference information corresponding to the target patch file to the entry file.
[0146] In some embodiments, the determination module 604 is specifically configured to:
[0147] Obtain a regular expression corresponding to the target version of the browser from the technical documentation corresponding to the target version of the browser;
[0148] The regular expression corresponding to the target version of the browser is stored in the target storage space.
[0149] Figure 6 Each module / unit in the device shown has the function of realizing Figures 1 to 4 The functions of each step executed by the application system in the present invention can achieve the corresponding technical effects. For the sake of brevity, they will not be repeated here.
[0150] Figure 7 A schematic diagram of the hardware structure of data detection provided by an embodiment of the present disclosure is shown.
[0151] The data detection device may include a processor 701 and a memory 702 storing computer program instructions.
[0152] Specifically, the processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0153] The memory 702 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 702 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 702 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid-state memory.
[0154] The memory 702 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present disclosure.
[0155] The processor 701 implements any one of the data detection methods in the above embodiments by reading and executing computer program instructions stored in the memory 702 .
[0156] In one example, the data detection device may further include a communication interface 703 and a bus 704. Figure 7 As shown, the processor 701, the memory 702, and the communication interface 703 are connected via a bus 704 and communicate with each other.
[0157] The communication interface 703 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0158] Bus 704 includes hardware, software or both, and couples the components of online data flow billing equipment to each other. For example, but not limitation, the bus may include Accelerated Graphics Port (AGP) or other graphics bus, Enhanced Industry Standard Architecture (EISA) bus, Front Side Bus (FSB), Hyper Transport (HT) interconnection, Industry Standard Architecture (ISA) bus, InfiniBand interconnection, Low Pin Count (LPC) bus, Memory bus, Micro Channel Architecture (MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-X) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association Local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 704 may include one or more buses. Although the embodiment of the present invention describes and illustrates a specific bus, the present invention considers any suitable bus or interconnection. In addition, in conjunction with the method for data detection in the above-mentioned embodiment, the present application embodiment also provides a computer storage medium to realize. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data detection methods in the above embodiments is implemented.
[0159] An embodiment of the present application also provides a computer program product, including a computer program, which implements any one of the data detection methods in the above embodiments when the computer program is executed by a processor.
[0160] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0161] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable ReadOnly Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0162] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0163] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0164] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A method for data detection, characterized in that: Applied to the target system, the method comprises: Using a monitoring component to detect target communication information sent by a target application, the target communication information indicates that initial code data compilation is complete; acquiring the initial code data from the target application program in the event that the target communication information is detected; Filtering target code data corresponding to preset code data from the initial code data to obtain code data, wherein the code data includes a character string; Get browser version information; Acquire a regular expression corresponding to the browser version information from the target storage space; Using the regular expression to detect the format of each character of the string; In a case where the format of each character of the string is consistent with the format of the screening characters corresponding to the regular expression, target information is determined, wherein the target information indicates that the code data is incompatible with the browser.
2. The method according to claim 1, characterized in that The target application includes a code compilation application, and the use of a monitoring component to detect target communication information sent by the target application includes: The monitoring component is used to detect the target communication information sent by the code compilation application.
3. The method according to claim 1, characterized in that The preset code data includes JavaScript code data, and the target code data corresponding to the preset code data is selected from the initial code data to obtain the code data, including: According to the code data type, target code data corresponding to the JavaScript code data is screened out from the initial code data to obtain the code data.
4. The method according to claim 1, characterized in that: After determining the target information, the method further includes: A target patch file corresponding to the target information is injected into the code data.
5. The method according to claim 4, characterized in that The injecting a target patch file corresponding to the target information into the code data includes: Acquire an initial target patch file from the target storage space; Deduplicating the initial target patch file to obtain a target patch file; The target patch file is injected into the code data.
6. The method according to any one of claims 4 to 5, characterized in that: The code data includes an entry file, and the injecting of a target patch file corresponding to the target information into the code data includes: Storing the target patch file in a file area having the same location information as the code data; Add the reference information corresponding to the target patch file to the entry file.
7. The method according to claim 1, characterized in that Before obtaining the browser version information, the method further includes: Determine the target browser version; Acquire a regular expression corresponding to the target version of the browser from a technical document corresponding to the target version of the browser; The regular expression corresponding to the target version of the browser is stored in the target storage space.
8. A data detection device, characterized in that: Applied to a target system, the device comprises: A detection module, the detection module is used to detect target communication information sent by a target application using a monitoring component, the target communication information indicating that the initial code data compilation is completed; an acquisition module, the acquisition module being used to acquire the initial code data from the target application program when the target communication information is detected; A screening module, the screening module is used to screen out target code data corresponding to preset code data from the initial code data to obtain code data, wherein the code data includes a character string; The acquisition module is also used to obtain browser version information; The acquisition module is further used to acquire a regular expression corresponding to the browser version information from the target storage space; The detection module is further used to detect the format of each character of the string using the regular expression; A determination module is used to determine target information when the format of each character of the string is consistent with the format of the screening character corresponding to the regular expression, wherein the target information indicates that the code data is incompatible with the browser.
9. A data detection device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the data detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for data detection according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the data detection method according to any one of claims 1 to 7.