A method and apparatus for business analysis

By intercepting business call requests and determining the code status based on the business name, the problem of code statistics relying on manual analysis in the existing technology is solved, and automated code optimization and performance improvement are achieved.

CN111290939BActive Publication Date: 2025-06-20BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201811503276.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-12-10
Publication Date
2025-06-20
Estimated Expiration
2038-12-10

AI Technical Summary

Technical Problem

The prior art mainly relies on manual identification or analysis of logs when stating code status, resulting in high difficulty, low execution efficiency and unsatisfactory results.

Method used

By intercepting the service call request, obtain the business name of the called service, and determine the available code and unpopular code based on the correspondence between the predetermined business name and the code. Optional steps include counting the business name, determining unpopular businesses and codes, and monitoring the system execution results after deleting unpopular codes.

Benefits of technology

Automatic code statistics and optimization are realized, reducing the difficulty of code optimization, improving the overall quality of the code and the operating performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111290939B_ABST
    Figure CN111290939B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and apparatus for service analysis, which relates to the field of computer technology. A specific embodiment of the method includes: when a service call request is monitored, intercepting the service call request and obtaining the service name of the called service in the service call request; wherein the service is the smallest granularity that can be operably executed; according to the corresponding relationship between the predetermined service name and the code, determining that the code corresponding to the service name is the available code. This embodiment can determine which codes are useful by counting the services called within a certain period of time, providing a basis for subsequent analysis of useless codes and code optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method and device for business analysis. Background Art

[0002] The system runs according to methods. As the system functions are continuously improved, after the system has run for a long time, many methods in the system have been repeatedly modified or abandoned. However, the code developers are not sure whether these methods will be used in the future and usually keep them, resulting in extremely bloated code. Therefore, it is particularly important to count which code is useful and perform code optimization and slimming.

[0003] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems:

[0004] For existing statistical methods, basically, they all rely on developers to manually identify or analyze logs to determine which methods are available and which methods have been abandoned. However, the amount of logs is usually large, the statistical difficulty is high, and the execution efficiency is low. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method and device for business analysis, which can at least solve the problems that the existing technology mainly relies on manpower for the statistics of code status, with high difficulty, low execution efficiency, and unsatisfactory results.

[0006] To achieve the above object, according to one aspect of the embodiments of the present invention, a method for business analysis is provided, including:

[0007] When a business call request is monitored, intercept the business call request and obtain the business name of the called business in the business call request; wherein, the business is the smallest granularity that can be operably executed;

[0008] According to the corresponding relationship between the predetermined business name and the code, determine the code corresponding to the business name as the available code.

[0009] Optionally, it further includes: counting the business names obtained within a predetermined time period, combining the predetermined business name records to determine the unpopular business; according to the corresponding relationship between the predetermined business name and the code, determine the code corresponding to the unpopular business as the unpopular code.

[0010] Optionally, after determining the code corresponding to the unpopular business as the unpopular code, it further includes: obtaining a first system, deleting the unpopular code in the first system to obtain a second system, and monitoring the execution result of the second system; when the execution result of the second system is the same as that of the first system, determine the unpopular code as the deletable code and the unpopular business as the deletable business.

[0011] Optionally, it further includes: obtaining the execution end timestamp of the service, and combining it with the timestamp when the service call request is monitored to determine the execution duration of the service; when the execution duration exceeds the predetermined execution duration, determining that the execution performance of the service is feasible.

[0012] To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided an apparatus for service analysis, including:

[0013] A service name determination module, configured to intercept the service call request when a service call request is monitored, and obtain the service name of the called service in the service call request; wherein, the service is the smallest operable and executable granularity;

[0014] A code analysis module, configured to determine the code corresponding to the service name as available code according to the corresponding relationship between the predetermined service name and the code.

[0015] Optionally, it further includes a cold code determination module, configured to: count the service names obtained within a predetermined time period, and combine the predetermined service name records to determine cold services; according to the corresponding relationship between the predetermined service name and the code, determine the code corresponding to the cold services as cold code.

[0016] Optionally, it further includes a deletable code determination module, configured to: obtain a first system, delete the cold code in the first system to obtain a second system, and monitor the execution result of the second system; when the execution result of the second system is the same as that of the first system, determine that the cold code is a deletable code and the cold service is a deletable service.

[0017] Optionally, it further includes a service performance analysis module, configured to: obtain the execution end timestamp of the service, and combine it with the timestamp when the service call request is monitored to determine the execution duration of the service; when the execution duration exceeds the predetermined execution duration, determine that the execution performance of the service is feasible.

[0018] To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided an electronic device for service analysis.

[0019] The electronic device according to the embodiments of the present invention includes: one or more processors; a storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the one or more processors to implement the service analysis method described in any one of the above.

[0020] To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, it implements the service analysis method described in any one of the above.

[0021] According to the solution provided by the present invention, one embodiment of the above invention has the following advantages or beneficial effects: a method statistics idea is constructed to monitor and count the methods called in the system within a certain period of time, and then analyze the available methods and unavailable methods, providing a basis for subsequent code optimization. For the determined unpopular code, by judging whether it has an impact on the system's operating performance, it is determined whether it can be deleted, which reduces the difficulty of code optimization.

[0022] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0024] Figure 1 This is a schematic diagram of the main process of a business analysis method according to an embodiment of the present invention;

[0025] Figure 2 is a schematic diagram of interaction between a system and a device provided in an embodiment of the present invention;

[0026] Figure 3 It is a schematic diagram of the overall process provided by an embodiment of the present invention;

[0027] Figure 4 is a schematic diagram of main modules of a device for business analysis according to an embodiment of the present invention;

[0028] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0029] Figure 6 It is a schematic diagram of the structure of a computer system of a mobile device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention 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 invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0031] It should be noted that the embodiment of the present invention is mainly used to count which methods have been called within a certain period of time. These called methods can be considered available, and the corresponding codes are available codes.

[0032] A system / application / interface / program (this invention will mainly be described in terms of a system) usually contains multiple methods, and basically all of them have been updated and transformed. Some of the historical code in the methods may be useless, which requires identifying and analyzing the methods / code to determine which are useless and which are useful.

[0033] In this invention, the invocation of a method can be divided into direct invocation and indirect invocation. A method may contain multiple sub-methods. When the execution of a sub-method is required for the invocation of a certain method, this is an indirect invocation.

[0034] To distinguish the implementation methods of this invention from the methods that can be invoked in the system, this invention uniformly uses "service" to represent the smallest granularity that can be operably executed. The so-called granularity is the combined scale of code units used in a system.

[0035] See Figure 1 , which shows the main flowchart of a method for service analysis provided by an embodiment of this invention, including the following steps:

[0036] S101: When a service invocation request is detected, intercept the service invocation request and obtain the service name of the service being invoked in the service invocation request; wherein, the service is the smallest granularity that can be operably executed;

[0037] S102: According to the corresponding relationship between the predetermined service name and the code, determine the code corresponding to the service name as the available code.

[0038] In the above implementation, for step S101, regarding the interception of the service being invoked in the system, it can be directly intercepted by an AOP (Aspect Oriented Programming) component when a service invocation request is detected.

[0039] Parse the service invocation request to determine which service is being invoked. Although some services may have operations such as code updates, their service names usually do not change. Therefore, this invention mainly analyzes through the service name.

[0040] Furthermore, in addition to the above service name, it is also possible to determine the class to which the service name belongs, and the dimension of class + service name is finer and can be used as the unique coordinate for determining the service. Here, "class" is a professional term in JAVA, and its English name is "CLASS", and the service name is written in the class. For example,

[0041] Class A{

[0042] Void method()

[0043] }

[0044] Among them, A is the class name and method is the business name.

[0045] Furthermore, there may be a situation where method names are repeated. Therefore, it is necessary to distinguish them by their respective classes to improve the accuracy of business analysis.

[0046] Therefore, it can be generated as a file name in the form of "class path + business name" to a specified directory, such as the directory / export / logs / of the server. Here, the class path is the storage location path where the class is located.

[0047] For the storage method, it can be a data recording method. For example, class - business name - request time, or it can be stored in the database in the form of a file. When a call request for this business is received again later, since there is already a record of this business name, there is no need to record it again.

[0048] For step S102, businesses all correspond to code, and a business needs to rely on the code to execute. Therefore, after determining the business name of the called business, it can be determined that its execution code is available.

[0049] Subsequently, for the statistics of the called business, it can be executed according to the obtained method name. Specifically:

[0050] Step 1: Statistically count the business names obtained within a predetermined time period, and combine with the business name records to determine the unpopular businesses in the system;

[0051] Step 2: According to the corresponding relationship between the predetermined business name and the code, determine the code corresponding to the unpopular business as the unpopular code.

[0052] For step 1, the statistical method here can be asynchronous statistics. For example, statistically count the business names through an independent self - starting thread, aiming not to affect the performance of the system main thread. And this thread works asynchronously, with less impact on the system working performance.

[0053] If the asynchronous statistical method is not adopted, a synchronous method can also be used, that is, immediately perform statistics after interception, but this will consume the system performance very much. This invention mainly adopts the asynchronous statistical method.

[0054] Business name records can be set in the system in advance. When there is a new business name added or a historical business name deleted in the system, the business name record table will be updated. Therefore, currently, the determination of unpopular businesses in the system (which can also be understood as infrequently used businesses or useless businesses) can be made by comparing the statistically counted business names and this record table.

[0055] For these unpopular businesses, they can be distinguished from the available businesses in a marked way.

[0056] For Step 2: Similarly, niche services are also composed of code, and the corresponding code is niche code, which can also be marked accordingly.

[0057] However, it should be noted that the deletion of useless code is relatively cautious. When to delete and how much to delete are specifically determined by developers. One month is too short, usually about half a year. If a certain method has not been called within this half year, it means that this method is rarely used or useless.

[0058] The specific judgment method can be:

[0059] Step 1: Obtain the first system, delete the niche code in the first system to obtain the second system, and monitor the execution result of the second system;

[0060] Step 2: When the execution result of the second system is the same as that of the first system, determine that the niche code is deletable code and the niche service is deletable service.

[0061] Regarding whether useless services and code can be deleted, two independent systems can be tested simultaneously in the test environment. The only difference between these two systems is whether they contain this niche code.

[0062] After a certain period of time, if it is found that the execution results of these two systems are the same, that is, the system after deleting the niche code has the same working performance as the one without deletion, it means that the marked code is indeed discardable code. To reduce resource occupation, deletion operations can be performed on it to achieve code slimming, and also reduce the subsequent code maintenance workload for easier maintenance.

[0063] It should be noted that the second system here can be obtained by deleting the niche code from the first system; it can also be directly non-existent, and the niche code needs to be added to the second system to obtain the first system.

[0064] Or, directly copy two copies of the source system (including niche code), and delete the niche code in one of the systems to obtain the first system and the second system described above. The acquisition methods of the two systems are not limited. The present invention mainly takes the example of deleting niche code from the first system to obtain the second system for illustration.

[0065] Furthermore, although some services are called, their performance may not meet the requirements, which can be determined specifically according to their execution duration, such as crashing.

[0066] Specifically:

[0067] Obtain the execution duration of the service. When the execution duration exceeds the predetermined execution duration, determine that the execution performance of this service is feasible.

[0068] For businesses whose performance does not meet the requirements, they can also be marked as "infeasible" to facilitate developers to carry out targeted performance solutions, provide guidance for future optimization, and avoid the time-consuming situation of running the method again to determine its performance.

[0069] The method provided by the embodiment of the present invention counts the services that have been called within a certain period of time, and then determines which codes are useful, providing a basis for subsequent analysis of useless codes and code optimization. For the determined unpopular codes, it is determined whether they can be deleted by judging whether they have an impact on the system performance, thereby reducing the difficulty of code optimization.

[0070] See also Figure 2 , showing an interaction diagram between a statistical device and a system provided by an embodiment of the present invention, including:

[0071] Application system, service call statistics device, service interception device and asynchronous statistics device; wherein, the service interception device and the asynchronous statistics device are both located in the service call statistics device.

[0072] See also Figure 3 , showing a call flow chart of the overall implementation process of the present invention:

[0073] 1) Application system: It can also be called target system or client system to count which of the services included are called.

[0074] 2) Business call statistics device: It is a device directly called by the application system. In the application system, it is necessary to configure the reference of the business interception device and then configure the correct statistics parameters, such as the statistics period (type is integer) and the statistics file path (type is string).

[0075] ① Business interception device: All businesses configured according to rules (for example, regular expressions) in the application system will be intercepted and recorded by the business interception device as long as they are called, and the business name of the called business (and the path of the class to which it belongs) will be obtained.

[0076] ②Asynchronous statistics device: According to the statistics interval configured by the application system, it periodically traverses all the statistical files and generates a summary file with the file list as the content. If you want to know which services have been called later, you can check the summary file.

[0077] In addition, asynchronous statistical devices can also be processed using current asynchronous processing frameworks, such as Quartz.

[0078] When a service is called multiple times, the service interception device will check whether the corresponding file exists according to the determined service name and class path. If it exists, it will not be generated again.

[0079] See Figure 4 , which shows a schematic diagram of the main modules of a service analysis device 400 provided by an embodiment of the present invention, including:

[0080] A service name determination module 401, configured to intercept the service call request and obtain the service name of the called service in the service call request when a service call request is monitored; wherein, the service is the smallest operable and executable granularity;

[0081] A code analysis module 402, configured to determine the code corresponding to the service name as available code according to the correspondence between the predetermined service name and the code.

[0082] The implementation device of the present invention further includes a cold code determination module 403 (not marked in the figure), configured to: count the service names obtained within a predetermined time period, and determine cold services in combination with the predetermined service name record; according to the correspondence between the predetermined service name and the code, determine the code corresponding to the cold service as cold code.

[0083] The implementation device of the present invention further includes a deletable code determination module 404 (not marked in the figure), configured to: obtain a first system, delete the cold code in the first system to obtain a second system, and monitor the execution result of the second system; when the execution result of the second system is the same as the execution result of the first system, determine the cold code as deletable code and the cold service as deletable service.

[0084] The implementation device of the present invention further includes a service performance analysis module 405 (not marked in the figure), configured to: obtain the execution end timestamp of the service, and determine the execution duration of the service in combination with the timestamp when the service call request is monitored; when the execution duration exceeds the predetermined execution duration, determine that the execution performance of the service is feasible.

[0085] In addition, the specific implementation content of the service analysis device in the embodiment of the present invention has been described in detail in the above service analysis method, so the repeated content will not be described here.

[0086] Figure 5 Shows an exemplary system architecture 500 to which the service analysis method or service analysis device of the embodiment of the present invention can be applied.

[0087] As Figure 5 shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505 (merely an example). The network 504 is used to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0088] Users can use terminal devices 501, 502, 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503.

[0089] Terminal devices 501, 502, 503 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and so on.

[0090] Server 505 can be a server providing various services, such as a background management server (only for example) that supports shopping websites browsed by users using terminal devices 501, 502, 503. The background management server can analyze and process data such as product information query requests received, and feedback the processing results to the terminal devices.

[0091] It should be noted that the method for business analysis provided by the embodiments of the present invention is generally executed by server 505. Correspondingly, the device for business analysis is generally arranged in server 505.

[0092] It should be understood that Figure 5 the numbers of terminal devices, networks, and servers in

[0093] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. Figure 6 Refer to Figure 6 below, which shows a schematic structural diagram of a computer system 600 of a terminal device suitable for implementing the embodiments of the present invention.

[0094] As Figure 6 shown, computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in read-only memory (ROM) 602 or the program loaded from storage section 608 into random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of system 600 are also stored. CPU 601, ROM 602, and RAM 603 are connected to each other via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0095] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0096] Specifically, according to an embodiment disclosed by the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment disclosed by the present invention includes a computer program product which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, the above-described functions defined in the system of the present invention are performed.

[0097] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0099] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a service name determination module and a code analysis module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the service name determination module may also be described as a "module for determining the name of the called service".

[0100] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0101] When a service call request is monitored, the service call request is intercepted and the service name of the called service in the service call request is obtained; wherein the service is the minimum granularity of operable execution; and according to the correspondence between the predetermined service name and the code, the code corresponding to the service name is determined to be an available code.

[0102] According to the technical solution of the embodiment of the present invention, by counting the services that have been called within a certain period of time, it is determined which codes are useful, which provides a basis for analyzing useless codes and optimizing codes. For the determined unpopular codes, it is determined whether they have an impact on the system performance and whether they can be deleted, which reduces the difficulty of code optimization.

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

Claims

1. A business analysis method, characterized in that, including: When a service call request is detected, intercept the service call request and obtain the service name of the called service in the service call request; wherein, the service is the smallest granularity that can be operably executed; the service is a method, and the call of the method includes an indirect call. An indirect call means that when a method contains multiple sub-methods, the call of the method requires the execution of its sub-methods; According to the correspondence between the predetermined service name and the code, determine the code corresponding to the service name as the useful code; Obtain the execution end timestamp of the service, and combine the timestamp when the service call request is detected to determine the execution duration of the service; When the execution duration exceeds the predetermined execution duration, determine that the execution performance of the service is feasible; Count the service names obtained within a predetermined duration, and combine the predetermined service name record to determine the unpopular services; According to the correspondence between the predetermined service name and the code, determine the code corresponding to the unpopular service as the unpopular code.

2. The method according to claim 1, characterized in that, After determining that the code corresponding to the unpopular service is the unpopular code, it further includes: Obtain the first system, delete the unpopular code in the first system to obtain the second system, and monitor the execution result of the second system; When the execution result of the second system is the same as the execution result of the first system, determine that the unpopular code is the deletable code and the unpopular service is the deletable service.

3. A business analysis device, characterized in that, including: A service name determination module, configured to intercept the service call request and obtain the service name of the called service in the service call request when a service call request is detected; wherein, the service is the smallest granularity that can be operably executed; the service is a method, and the call of the method includes an indirect call. An indirect call means that when a method contains multiple sub-methods, the call of the method requires the execution of its sub-methods; A code analysis module, configured to determine the code corresponding to the service name as the available code according to the correspondence between the predetermined service name and the code; A service performance analysis module, configured to obtain the execution end timestamp of the service, and combine the timestamp when the service call request is detected to determine the execution duration of the service; when the execution duration exceeds the predetermined execution duration, determine that the execution performance of the service is feasible; An unpopular code determination module, configured to: count the service names obtained within a predetermined duration, and combine the predetermined service name record to determine the unpopular services; According to the correspondence between the predetermined service name and the code, determine the code corresponding to the unpopular service as the unpopular code.

4. The device according to claim 3, characterized in that, It further includes a deletable code determination module, configured to: Obtain the first system, delete the unpopular code in the first system to obtain the second system, and monitor the execution result of the second system; When the execution result of the second system is the same as the execution result of the first system, determine that the unpopular code is the deletable code and the unpopular service is the deletable service.

5. An electronic device, characterized in that, including: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-2.

6. A computer-readable medium, on which a computer program is stored, characterized in that, When the program is executed by a processor, it implements the method according to any one of claims 1-2.

Citation Information

Patent Citations

  • Method and system for inspecting source code corresponding to system function

    CN101154223A