CN114489673A - Method and device for deleting invalid codes in application program - Google Patents

Method and device for deleting invalid codes in application program Download PDF

Info

Publication number
CN114489673A
CN114489673A CN202210105923.8A CN202210105923A CN114489673A CN 114489673 A CN114489673 A CN 114489673A CN 202210105923 A CN202210105923 A CN 202210105923A CN 114489673 A CN114489673 A CN 114489673A
Authority
CN
China
Prior art keywords
code
page
application program
deleting
point data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210105923.8A
Other languages
Chinese (zh)
Inventor
韩天助
张银成
陈烨
冯宇东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210105923.8A priority Critical patent/CN114489673A/en
Publication of CN114489673A publication Critical patent/CN114489673A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4434Reducing the memory space required by the program code
    • G06F8/4435Detection or removal of dead or redundant code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The invention can be used in the technical field of application of big data technology in finance, and provides a method and a device for deleting invalid codes in an application program, wherein the method for deleting the invalid codes in the application program comprises the following steps: performing PV (point embedding) in all code pages in an application program; obtaining historical PV buried point data of all the code pages according to the PV buried point data; and deleting invalid codes in the application program according to the historical PV buried point data. The method and the device for deleting the invalid codes in the application program can save a large amount of labor cost in the process of deleting the invalid codes, reduce the risk of modifying the application program every time, and keep the installation package of the application program in a small state.

Description

Method and device for deleting invalid codes in application program
Technical Field
The application belongs to the technical field of big data, and particularly relates to a method and a device for deleting invalid codes in an application program.
Background
With the increasing volume of the internet, business function updating iteration is fast, and invalid codes existing in most application programs are more and more, which slowly become burdens for corresponding enterprises. It is understood that invalid code refers to code that has never been executed in a program, the first refers to code that appears after a condition of constant false or return, and the second refers to branch code that is generated by product iterations and that is never executed.
In the prior art, the technicians in the industry can only process the first invalid codes through compiler optimization, but the second invalid codes mainly depend on manual screening, and no mature scheme exists. Moreover, manual screening of the second invalid codes requires a large amount of manpower, and the requirement is that the proficiency of the program is high, so that the problems that the program cannot be compiled or runs and crashes due to mistaken deletion exist, the maturity is low, and the expandability is poor.
Disclosure of Invention
The method and the device for deleting the invalid codes in the application program can save a large amount of labor cost in the process of deleting the invalid codes, reduce the risk of modifying the application program every time, and keep the installation package of the application program in a small state.
In order to solve the technical problems in the background art of the application, the invention provides the following technical scheme:
in a first aspect, the present invention provides a method for deleting an invalid code in an application program, including:
performing PV (point embedding) in all code pages in an application program;
obtaining historical PV buried point data of all the code pages according to the PV buried point data;
and deleting invalid codes in the application program according to the historical PV buried point data.
In one embodiment, the performing PV landfilling in all code pages in an application includes:
initializing the code page;
and performing PV (point embedding) on the initialized code page.
In one embodiment, the initializing the code page includes:
and performing page initialization on the corresponding page code according to the literal quantity in the code page.
In an embodiment, the page initialization for the page code corresponding to the code page according to the literal quantity in the code page includes:
searching a digital identifier in the code page;
and generating the word size according to the digital identification.
In one embodiment, the deleting invalid code in the application program according to the historical PV buried point data comprises:
determining a code page of zero PV buried point data in the application program according to the historical PV buried point data;
and traversing the code page of the zero PV buried point, and deleting the corresponding page file code under the code path.
In one embodiment, said deleting invalid code in said application program according to said historical PV buried point data further comprises:
deleting a reference file of the code page of the zero PV buried point;
the reference file includes: header file reference file, page initialization reference file, and method call reference file.
In a second aspect, the present invention provides an apparatus for deleting invalid codes in an application, the apparatus comprising:
the page point burying module is used for performing PV point burying in all code pages in the application program;
the buried point data receiving module is used for acquiring historical PV buried point data of all the code pages according to the PV buried point data;
and the code deleting module is used for deleting invalid codes in the application program according to the historical PV buried point data.
In one embodiment, the page burial point module includes:
the page initialization unit is used for initializing the code page;
the page point burying unit is used for performing PV point burying on the initialized code page;
in one embodiment, the page initialization unit includes:
and the page initialization subunit is used for carrying out page initialization on the corresponding page code according to the literal quantity in the code page.
In one embodiment, the page initialization subunit includes:
the digital identifier searching unit is used for searching the digital identifier in the code page;
the word amount generating unit is used for generating the word amount according to the digital identification;
in one embodiment, the code deletion module includes:
the zero-embedded point page determining unit is used for determining a code page of the zero PV embedded point data in the application program according to the historical PV embedded point data;
the code deleting unit is used for traversing the code page of the zero PV buried point and deleting the corresponding page file code under the code path;
in one embodiment, the code deleting module further comprises:
a reference file deleting unit, configured to delete a reference file for the code page with the zero PV buried point;
the reference file includes: header file reference file, page initialization reference file, and method call reference file.
In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for deleting invalid codes in an application program when executing the program.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a method for deleting invalid code in an application.
As can be seen from the above description, an embodiment of the present invention provides a method and an apparatus for deleting an invalid code in an application program, where the corresponding method includes: firstly, performing PV (point embedding) in all code pages in an application program; then, acquiring historical PV buried point data of all code pages according to the PV buried points; and finally, deleting invalid codes in the application program according to the historical PV buried point data. The invention can save a large amount of labor cost in the process of deleting the invalid codes, does not depend on the technical level of technical personnel, has good expansibility and is cheap to popularize and reuse. The risk of modifying the application program every time is reduced, and the installation package of the application program can be kept in a small state.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a first structural diagram of a system for deleting invalid codes in an application according to an embodiment of the present application;
FIG. 2 is a second structural diagram of a system for deleting invalid codes in an application according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for deleting invalid code in an application according to an embodiment of the present invention;
FIG. 4 is a flow chart illustrating step 100 according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating step 101 according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating step 1011 according to an embodiment of the present invention;
FIG. 7 is a first flowchart of step 300 according to an embodiment of the present invention;
FIG. 8 is a second flowchart of step 300 in an embodiment of the present invention;
FIG. 9 is a diagram illustrating a method for deleting invalid code from an application according to an embodiment of the present invention;
FIG. 10 is a flowchart illustrating a method for deleting invalid code in an application according to an embodiment of the present invention;
FIG. 11 is a block diagram of an apparatus for deleting invalid code in an application according to an embodiment of the present invention;
FIG. 12 is a block diagram of page burial point module 10 according to an embodiment of the present invention;
FIG. 13 is a block diagram of page initialization unit 101 according to an embodiment of the present invention;
FIG. 14 is a first block diagram of a code removal module 30 according to an embodiment of the present invention;
FIG. 15 is a second block diagram of the code removal module 30 according to the embodiment of the present invention;
fig. 16 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of this application and the above-described drawings, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The present application further provides a system for deleting invalid codes in an application, and referring to fig. 1, the system may be a server a1, the server a1 may be communicatively connected to a plurality of PV buried-point devices B1, the server a1 may also be communicatively connected to a plurality of databases respectively, or as shown in fig. 2, these databases may also be disposed in the server a1 therebetween. Where PV buried point installation B1 is used to receive the server's PV buried point data in real time. After receiving the PV buried point data, server A1 determines historical PV buried point data from the PC buried point data and then deletes invalid code in the application from the historical PV buried point data. It should be noted that, the system for deleting the invalid code in the application program should be at the server side, and preferably, it may be installed outside the server from which the invalid code is deleted, or may be implemented as a module or a program within the server, and the present invention is not limited thereto.
It is understood that client C1 may include a smartphone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), an in-vehicle device, a smart wearable device, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, the part for deleting the invalid code in the application program can be executed on the side of the server a1 as described above, that is, the architecture shown in fig. 1 or fig. 2, or all the operations can be completed in the client C1 device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. If all the operations are completed in the client device, the client device may further include a processor configured to perform PV embedding in all the code pages in the application program and receive historical PV embedding data of all the code pages; and deleting invalid codes in the application program according to the historical PV buried point data.
The client C1 device may have a communication module (i.e., a communication unit) to communicate with a remote server for data transmission. The server may include a server on the side of deleting invalid code in the application, and in other implementations may include a server of an intermediate platform, such as a server of a third party server platform that is communicatively linked to the server that deletes invalid code in the application. The server may comprise a single computer device, or may comprise a server cluster formed by a plurality of servers, or a server structure of a distributed device.
The server and client devices may communicate using any suitable network protocol, including network protocols not yet developed at the filing date of this application. The network protocols may include, for example, TCP/IP protocol, UDP/IP protocol, HTTP protocol, HTTPS protocol, and the like. Of course, the network Protocol may also include, for example, an RPC Protocol (Remote Procedure Call Protocol) used above the above Protocol, a REST Protocol (Representational State Transfer Protocol), and the like.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
An embodiment of the present invention provides a specific implementation of a method for deleting an invalid code in an application program, and referring to fig. 3, the method specifically includes the following steps:
step 100: performing PV (point embedding) in all code pages in an application program;
the data embedding point is an important mode of data acquisition, is mainly used for recording and collecting operation behaviors of a terminal user, and has the basic principle that acquired SDK codes are deployed at terminals such as App/H5/PC (personal computer), when the behaviors of the user meet certain conditions, such as entering a certain page, clicking a certain button and the like, the recording and the storage are automatically triggered, and then the data are collected and transmitted to a terminal provider, or requested data in the process of using services by the user are collected through a back end.
Pv (page view) embedded point, i.e. page view quantity statistical method, is usually the main index for measuring a network news channel or website and even a network news. The number of web pages viewed is one of the most common indicators for evaluating the website traffic, abbreviated as PV. Monitoring the change trend of the PV of the website and analyzing the change reason are the work that many station managers need to do regularly. The pages in the Page Views generally refer to ordinary html web pages, and also include dynamically generated html contents such as php and jsp. One html content request from the browser will be treated as one PV, gradually accumulating into a PV total
PV sites can be divided into proxy sites, visual sites, and full sites. Its advantages and disadvantages are as follows:
code embedding: the advantages are that: the controllability is high, and all requirements are met; the disadvantages are as follows: the research and development cost and the design cost are high.
Visual point burying: the advantages are that: in the aspect of operation, the arrangement is quick; the disadvantages are as follows: the adaptability is poor, and the latitude matching degree is different according to ways.
Burying points in a full scale: the advantages are that: the user can know all actions; the disadvantages are as follows: the data transmission quantity is large, the data needs to be cleaned for the second time, and a large amount of real-time resources are occupied for data transmission.
When the step 100 is implemented, a js script is embedded into each code page containing an application program, so that when a user accesses the corresponding code page, the js script is automatically triggered to collect a user access behavior log and the log is submitted to a log server.
Step 200: obtaining historical PV buried point data of all the code pages according to the PV buried point data;
preferably, historical PV site data for the past year may be selected, or may be received periodically, for example every 6 months.
Step 300: and deleting invalid codes in the application program according to the historical PV buried point data.
Specifically, PV buried point data of all pages of an application program in the last year is inquired, and all page lists are obtained from an engineering code path; then, performing inverse intersection on a page list returned by the query application and a page list in the engineering code path to obtain a page list of zero PV buried points; and finally, circularly traversing the zero PV page list, and deleting the corresponding file code under the engineering code path.
As can be seen from the foregoing description, an embodiment of the present invention provides a method for deleting an invalid code in an application program, including: firstly, performing PV (point embedding) in all code pages in an application program; then, obtaining historical PV buried point data of all code pages according to the PV buried points; and finally, deleting invalid codes in the application program according to the historical PV buried point data. The invention can save a large amount of labor cost in the process of deleting the invalid codes, does not depend on the technical level of technical personnel, has good expansibility and is cheap to popularize and reuse. The risk of modifying the application program every time is reduced, and the installation package of the application program can be kept in a small state.
In one embodiment, referring to fig. 4, step 100 specifically includes:
step 101: initializing the code page;
it is understood that the code page initialization in step 101 means that when the server accesses the code page, the server can initialize the code page according to the default selection data set when the code page is accessed previously, so that the code page can run on the default selection data.
Step 102: and performing PV (point embedding) on the initialized code page.
In steps 101 and 102, when any code page of the application program is initialized, PV embedding is performed on the code page, and the embedded data is uploaded to the server side for storage.
In one embodiment, referring to fig. 5, step 101 comprises:
step 1011: and performing page initialization on the corresponding page code according to the literal quantity in the code page.
The literal volume (literal) here is a representation (notation) for expressing a fixed value in the source code. Almost all computer programming languages have a literal representation of a base value, such as: integer, floating point, and string; there are many values that also support literal representation for boolean and character types; still others support literal representations even for enumerated types of elements and complex types of values like arrays, records, and objects.
101, when implementing, page initialization is performed through a fixed page initialization method, such as new or alloc init, through a font quantity, such as a character string font quantity (string font quantity) refers to a series of characters attracted by a double quotation mark, and the double quotation mark may have no character, only one character, or a plurality of characters) to convert names, etc.;
in one embodiment, referring to fig. 6, step 1011 further comprises:
step 10111: searching a digital identifier in the code page;
specifically, the level codes in the code page are determined, and the digital identifications are searched in the level codes.
Step 10112: and generating the word size according to the digital identification.
On the basis of step 10111, all the numeric identifiers are assembled in a manner of being arranged adjacently, that is, one numeric identifier and the data identifier of one default selection data immediately following the numeric identifier may together form a literal quantity.
In one embodiment, referring to fig. 7, step 300 includes:
step 301: determining a code page of zero PV buried point data in the application program according to the historical PV buried point data;
step 302: and traversing the code page of the zero PV buried point, and deleting the corresponding page file code under the code path.
Specifically, in step 301 and step 302, a historical PV query buried point data application is first sent to the server database; the query application returns PV buried point data of all pages of the application program in the last year; when sending a query application, acquiring all page lists from the engineering code path; performing inverse intersection on the page list returned by the query application and the page list in the engineering code path to obtain a page list of zero PV buried points; circularly traversing the zero PV page list, removing the import reference of the corresponding page file in the engineering configuration, and preventing the operation error report when the program is compiled and packaged; circularly traversing the zero PV page list, and deleting the corresponding page file code under the engineering code path; circularly traversing the zero PV page list, and deleting code references of zero PV pages in other files of the program, wherein the code references comprise header file references, page initialization and method calling, so that the program is prevented from compiling and reporting errors;
in one embodiment, referring to fig. 8, step 300 further comprises:
step 303: deleting a reference file of the code page of the zero PV buried point;
the reference file includes: header file reference file, page initialization reference file, and method call reference file.
Specifically, circularly traversing the zero PV page list, and deleting the code reference files of the zero PV code page, including a header file reference file, a page initialization reference file and a method call reference file, so as to prevent the program from compiling and reporting errors;
in a specific embodiment, the present invention further provides a specific embodiment of a method (tool) for deleting invalid codes in an application program, taking APP (application, mainly referring to software installed on a smart phone, to improve the deficiency and personalization of an original system, and making the phone complete its functions and provide a user with a richer use experience, and the operation of the phone software requires a corresponding phone system, as an example, see fig. 9 and fig. 10, which specifically include the following contents.
S1, when any page of the APP is initialized, a PV embedding point is carried out, and data are uploaded to a server side to be stored;
s2, the tool supports the configuration of the engineering code path, and the last configuration is displayed by default;
s3, the tool supports the PV embedded data server link configuration, and the last configuration is displayed by default;
s4, the tool supports the configuration engineering compiling script, and returns to display the last configuration by default;
s5, the operator starts to execute, the tool sends a query application to the server database;
s6, inquiring and applying for returning PV buried point data of all the APP pages in the last year;
s7, when sending the query application, all page lists are obtained from the engineering code path at the same time;
s8, performing inverse intersection on the page list returned by the query application and the page list in the engineering code path to obtain a page list of zero PV buried points;
s9, circularly traversing the zero PV page list, removing the import reference of the corresponding page file in the engineering configuration, and preventing the operation error when the program is compiled and packaged;
s10, circularly traversing the zero PV page list, and deleting the corresponding page file code under the engineering code path;
s11, circularly traversing the zero PV page list, and deleting code references of the zero PV page in other files of the program, wherein the code references comprise header file references, page initialization and method calling, so that the program is prevented from compiling and reporting errors;
s12 page initialization includes: page initialization is performed through a fixed page initialization method, such as new or alloc init, through a font quantity, such as a character string class name;
s13 the page call includes: initializing a generated page object, a code called by the page object and a called code;
s14, completing traversal, and automatically executing the configured engineering compiling script;
s15, compiling successfully, automatically recording operation logs and file change records, facilitating subsequent review, and automatically extracting the modified content; the process is finished.
S16, compiling fails, operation logs and file change records are automatically recorded, so that the troubleshooting and subsequent tool optimization of operators are facilitated, modified contents are temporarily stored in a working area, and an alarm mail is sent to inform the operators;
and S17, pulling the content of the temporary storage working area to the local by an operator, performing targeted repair, and executing the configured engineering compiling script again in the step S14 after the repair is finished.
As can be seen from the foregoing description, an embodiment of the present invention provides a method for deleting an invalid code in an application program, including: firstly, performing PV (point embedding) in all code pages in an application program; then, acquiring historical PV buried point data of all code pages according to the PV buried points; and finally, deleting invalid codes in the application program according to the historical PV buried point data. The invention can save a large amount of labor cost in the process of deleting the invalid codes, does not depend on the technical level of technical personnel, has good expansibility and is cheap to popularize and reuse. The risk of modifying the application program every time is reduced, and the installation package of the application program can be kept in a small state.
Based on the same inventive concept, the embodiment of the present application further provides a device for deleting invalid codes in an application program, which can be used to implement the method described in the foregoing embodiment, such as the following embodiments. Because the principle of solving the problem of the device for deleting the invalid codes in the application program is similar to the method for deleting the invalid codes in the application program, the implementation of the device for deleting the invalid codes in the application program can be implemented by referring to the method for deleting the invalid codes in the application program, and repeated details are not repeated. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. While the system described in the embodiments below is preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
An embodiment of the present invention provides a specific implementation manner of a device for deleting an invalid code in an application, which can implement a method for deleting an invalid code in an application, and referring to fig. 11, the device for deleting an invalid code in an application specifically includes the following contents:
the page embedding module 10 is used for performing PV embedding on all code pages in an application program;
the buried point data receiving module 20 is used for acquiring historical PV buried point data of all the code pages according to the PV buried point data;
and the code deleting module 30 is used for deleting invalid codes in the application program according to the historical PV buried point data.
In one embodiment, referring to fig. 12, the page burial point module 10 includes:
a page initialization unit 101, configured to initialize the code page;
the page point burying unit 102 is used for performing PV point burying on the initialized code page;
in one embodiment, referring to fig. 13, the page initialization unit 101 includes:
and the page initialization subunit 1011 is configured to perform page initialization on the corresponding page code according to the literal quantity in the code page.
In one embodiment, referring to fig. 14, the code deleting module 30 includes:
a zero-embedded point page determining unit 301, configured to determine, according to the historical PV embedded point data, a code page of the zero-PV embedded point data in the application program;
the code deleting unit 302 is used for traversing the code page of the zero PV buried point and deleting the corresponding page file code under the code path;
in one embodiment, referring to fig. 15, the code deleting module further includes:
a reference file deleting unit 303, configured to delete a reference file for the code page with the zero PV fixed point;
the reference file includes: header file reference file, page initialization reference file, and method call reference file.
As can be seen from the foregoing description, an embodiment of the present invention provides an apparatus for deleting invalid codes in an application program, including: firstly, performing PV (point embedding) in all code pages in an application program; then, acquiring historical PV buried point data of all code pages according to the PV buried points; and finally, deleting invalid codes in the application program according to the historical PV buried point data. The invention can save a large amount of labor cost in the process of deleting the invalid codes, does not depend on the technical level of technical personnel, has good expansibility and is cheap to popularize and reuse. The risk of modifying the application program every time is reduced, and the installation package of the application program can be kept in a small state.
An embodiment of the present application further provides a specific implementation manner of an electronic device, which is capable of implementing all steps in the method for deleting an invalid code in an application program in the foregoing embodiment, and referring to fig. 16, the electronic device specifically includes the following contents:
a processor (processor)1201, a memory (memory)1202, a communication Interface (Communications Interface)1203, and a bus 1204;
the processor 1201, the memory 1202 and the communication interface 1203 complete communication with each other through the bus 1204; the communication interface 1203 is used for implementing information transmission between related devices such as server-side devices and client-side devices;
the processor 1201 is configured to call the computer program in the memory 1202, and the processor executes the computer program to implement all the steps in the method for deleting the invalid code in the application program in the above embodiments, for example, the processor executes the computer program to implement the following steps:
step 100: performing PV (point embedding) in all code pages in an application program;
step 200: obtaining historical PV buried point data of all the code pages according to the PV buried point data;
step 300: and deleting invalid codes in the application program according to the historical PV buried point data.
Embodiments of the present application further provide a computer-readable storage medium capable of implementing all steps in the method for deleting invalid code in an application program in the foregoing embodiments, where the computer-readable storage medium stores thereon a computer program, and when the computer program is executed by a processor, the computer program implements all steps in the method for deleting invalid code in an application program in the foregoing embodiments, for example, when the processor executes the computer program, the processor implements the following steps:
step 100: performing PV (point embedding) in all code pages in an application program;
step 200: obtaining historical PV buried point data of all the code pages according to the PV buried point data;
step 300: and deleting invalid codes in the application program according to the historical PV buried point data.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the hardware + program class embodiment, since it is substantially similar to the method embodiment, the description is simple, and the relevant points can be referred to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Although the present application provides method steps as in an embodiment or a flowchart, more or fewer steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or client product executes, it may execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, in implementing the embodiments of the present description, the functions of each module may be implemented in one or more software and/or hardware, or a module implementing the same function may be implemented by a combination of multiple sub-modules or sub-units, and the like. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
The embodiments of this specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The described embodiments may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of an embodiment of the specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
The above description is only an example of the embodiments of the present disclosure, and is not intended to limit the embodiments of the present disclosure. Various modifications and variations to the embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present specification should be included in the scope of the claims of the embodiments of the present specification.

Claims (10)

1. A method for deleting invalid codes in an application program is characterized by comprising the following steps:
performing PV (point embedding) in all code pages in an application program;
obtaining historical PV buried point data of all the code pages according to the PV buried point data;
and deleting invalid codes in the application program according to the historical PV buried point data.
2. The method for deleting invalid code in an application program according to claim 1, wherein the performing PV trapping in all code pages in the application program comprises:
initializing the code page;
and performing PV (point embedding) on the initialized code page.
3. The method for deleting invalid code in an application program according to claim 2, wherein the initializing the code page includes:
and performing page initialization on the corresponding page code according to the literal quantity in the code page.
4. The method for deleting invalid codes in an application program according to claim 3, wherein the page initialization of the corresponding page code according to the literal quantity in the code page comprises:
searching a digital identifier in the code page;
and generating the word size according to the digital identification.
5. The method for deleting invalid code in an application program according to claim 1, wherein the deleting invalid code in the application program according to the historical PV buried point data comprises:
determining a code page of zero PV buried point data in the application program according to the historical PV buried point data;
and traversing the code page of the zero PV buried point, and deleting the corresponding page file code under the code path.
6. The method of claim 5, wherein said deleting invalid code from said application based on said historical PV buried point data further comprises:
deleting a reference file of the code page of the zero PV buried point;
the reference file includes: header file reference file, page initialization reference file, and method call reference file.
7. An apparatus for deleting invalid code in an application, comprising:
the page point burying module is used for performing PV point burying in all code pages in the application program;
the buried point data receiving module is used for acquiring historical PV buried point data of all the code pages according to the PV buried point data;
and the code deleting module is used for deleting invalid codes in the application program according to the historical PV buried point data.
8. The apparatus for deleting invalid code in an application program according to claim 7, wherein the page burial point module comprises:
the page initialization unit is used for initializing the code page;
the page point burying unit is used for performing PV point burying on the initialized code page;
the page initialization unit includes:
the page initialization subunit is used for carrying out page initialization on the corresponding page code according to the literal quantity in the code page;
the page initialization subunit includes:
the digital identifier searching unit is used for searching the digital identifier in the code page;
the word amount generating unit is used for generating the word amount according to the digital identification;
the code deletion module comprises:
the zero-embedded point page determining unit is used for determining a code page of the zero-PV embedded point data in the application program according to the historical PV embedded point data;
the code deleting unit is used for traversing the code page of the zero PV buried point and deleting the corresponding page file code under the code path;
a reference file deleting unit, configured to delete a reference file for the code page with the zero PV buried point;
the reference file includes: header file reference file, page initialization reference file, and method call reference file.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for deleting invalid code in an application program according to any one of claims 1 to 6 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of a method for deleting invalid code in an application program according to any one of claims 1 to 6.
CN202210105923.8A 2022-01-28 2022-01-28 Method and device for deleting invalid codes in application program Pending CN114489673A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210105923.8A CN114489673A (en) 2022-01-28 2022-01-28 Method and device for deleting invalid codes in application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210105923.8A CN114489673A (en) 2022-01-28 2022-01-28 Method and device for deleting invalid codes in application program

Publications (1)

Publication Number Publication Date
CN114489673A true CN114489673A (en) 2022-05-13

Family

ID=81476584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210105923.8A Pending CN114489673A (en) 2022-01-28 2022-01-28 Method and device for deleting invalid codes in application program

Country Status (1)

Country Link
CN (1) CN114489673A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627959A (en) * 2023-07-26 2023-08-22 合肥思迈科技有限公司 Method for clearing operation history data of movable ring equipment of machine room

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627959A (en) * 2023-07-26 2023-08-22 合肥思迈科技有限公司 Method for clearing operation history data of movable ring equipment of machine room
CN116627959B (en) * 2023-07-26 2023-10-13 合肥思迈科技有限公司 Method for clearing operation history data of movable ring equipment of machine room

Similar Documents

Publication Publication Date Title
CN107562620B (en) Automatic buried point setting method and device
CN105243159A (en) Visual script editor-based distributed web crawler system
CN101971172B (en) Mobile sitemaps
CN105138312B (en) A kind of table generation method and device
US20210056073A1 (en) Block data storage system in an event historian
CN110263070B (en) Event reporting method and device
CN109829121B (en) Method and device for reporting click behavior data
CN103428076A (en) Method and device for transmitting information to multi-type terminals or applications
CN101484892B (en) A method of managing web services using integrated document
CN106873952B (en) Data processing system and method for mobile terminal webpage development and application device
US20160171055A1 (en) Data query interface system in an event historian
CN109783562B (en) Service processing method and device
CN111367760B (en) Log collection method and device, computer equipment and storage medium
US20210064453A1 (en) Automated application programming interface (api) specification construction
CN101441629A (en) Automatic acquiring method of non-structured web page information
CN108574669A (en) User behavior tree constructing method and device
CN109408763B (en) Method and system for managing resume of different templates
CN113868248A (en) Index data pre-polymerization method
CN110598135A (en) Network request processing method and device, computer readable medium and electronic equipment
CN110554951B (en) Buried point management method and device
CN114489673A (en) Method and device for deleting invalid codes in application program
CN111680247B (en) Local calling method, device and equipment of webpage character strings and storage medium
CN105099829A (en) Electronic resource service availability automatic monitoring method based on HTTP (Hyper Text Transfer Protocol) protocol
CN106815248A (en) Web analytics method and device
CN112699291A (en) Task acquisition platform implementation method based on crawler system

Legal Events

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