[go: up one dir, main page]

CN111722874B - Automatic cleaning method, device and equipment for mobile terminal codes and storage medium - Google Patents

Automatic cleaning method, device and equipment for mobile terminal codes and storage medium Download PDF

Info

Publication number
CN111722874B
CN111722874B CN202010590146.1A CN202010590146A CN111722874B CN 111722874 B CN111722874 B CN 111722874B CN 202010590146 A CN202010590146 A CN 202010590146A CN 111722874 B CN111722874 B CN 111722874B
Authority
CN
China
Prior art keywords
file
activity
disposable
module
routing
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.)
Active
Application number
CN202010590146.1A
Other languages
Chinese (zh)
Other versions
CN111722874A (en
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202010590146.1A priority Critical patent/CN111722874B/en
Publication of CN111722874A publication Critical patent/CN111722874A/en
Application granted granted Critical
Publication of CN111722874B publication Critical patent/CN111722874B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Library & Information Science (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an automatic cleaning method for mobile terminal codes, and belongs to the field of computer software. The method comprises the following steps: invoking a background interface to inquire the activity state of a disposable activity module, wherein the activity state is used for indicating that the disposable activity is in progress or is ended; if the activity state indicates that the one-time activity is finished, acquiring the name of a routing file configured by the one-time activity module by querying an activity configuration routing page; annotating a code where the name of the routing file is located, and returning the name of the routing file to the background; and calling the deleting method provided by the background, and deleting the active folder and the configured routing file where the disposable active module is located. The invention can reduce the webpage volume of the mobile terminal, quicken the loading speed, reduce the pressure and network loading of the request background, optimize the process, and enable the page to be loaded faster and respond to the operation of the mobile terminal more timely after the optimization.

Description

Automatic cleaning method, device and equipment for mobile terminal codes and storage medium
Technical Field
The present invention relates to the field of computer software, and in particular, to a method, an apparatus, a device, and a storage medium for automatically cleaning a mobile terminal code.
Background
In Javascript language we have difficulty avoiding the garbage overhead entirely, since strings, objects and tuples are not of a fixed size, all when their size is known, they can be allocated dynamically. Each time a JavaScript program creates a string, array, or object, the interpreter must allocate memory to store that entity. As long as memory is dynamically allocated as such, eventually the memory is released so that they can be reused, otherwise, the JavaScript interpreter will consume all the available memory in the system, causing a system crash. Thus, javaScript programs require garbage collection, which generally has two methods: tag cleanup and reference counting, wherein reference counting is less common and tag cleanup is more common.
However, both garbage collection modes are fundamentally incompatible with real-time software requirements such as gaming. As various activities are held every festival in the mobile terminal project, codes of the code development activities at the front end are accumulated, a plurality of pictures and files are loaded in the mobile terminal project, the running speed of the project is slower and slower, the loading speed is reduced, and the satisfaction degree of the client is affected.
Therefore, the front end needs to timely delete codes and reduce weight for disposable activities, and classify and categorize the codes.
Disclosure of Invention
The invention aims to solve the technical problems that in the prior art, too much garbage of game software at a mobile terminal cannot be cleared timely, so that the running speed of the mobile terminal is reduced, and provides an automatic mobile terminal code clearing method, device, equipment and storage medium.
The invention solves the technical problems by the following technical scheme:
an automatic cleaning method for mobile terminal codes comprises the following steps:
invoking a background interface to inquire the activity state of a disposable activity module, wherein the activity state is used for indicating that the disposable activity is in progress or is ended;
if the activity state indicates that the one-time activity is finished, acquiring the name of a routing file configured by the one-time activity module by querying an activity configuration routing page;
annotating a code where the name of the routing file is located, and returning the name of the routing file to the background;
and calling the deleting method provided by the background, and deleting the active folder and the configured routing file where the disposable active module is located.
Preferably, before the calling the background interface to query the activity state of the disposable activity module, the method further comprises the following steps:
code segmentation is carried out on the active codes to form a plurality of asynchronous blocks, wherein the asynchronous blocks comprise disposable active blocks and conventional active blocks;
packing each asynchronous block as a file, and correspondingly packing the disposable movable blocks into the disposable movable modules;
and configuring a separate routing file for each disposable activity module.
Preferably, the background queries the activity state of the disposable activity module through monitoring of the timing task.
Preferably, when deleting the active folder and the configured routing file where the disposable active module is located, the method further comprises the following steps:
and storing the routing file and the related information of the disposable activity into an array queue.
Preferably, the annotation comprises the steps of:
reading a file containing the initial code of the name of the routing file into an initial file stream and converting the initial file stream into a character string;
searching a character string segment representing the name of the routing file in the character string through regular judgment;
marking the searched character string fragments in the character string, wherein the marking comprises the steps of respectively inserting markers at the head and the tail of the character string fragments;
converting the character string with the label into an updated file stream;
and writing the updated file stream into the file to cover the initial code.
Preferably, the deleting of the routing file includes the steps of:
searching the code of the file for the marker;
and deleting codes representing names of the routing files after the markers.
The invention also discloses an automatic cleaning device for the mobile terminal codes, which comprises:
the state query module is used for calling the background interface to query the activity state of the disposable activity module, wherein the activity state is used for indicating that the disposable activity is in progress or is ended;
the route inquiry module is used for inquiring an activity configuration route page to acquire the name of a route file configured by the disposable activity module when the activity state indicates that the disposable activity is finished;
the annotation module is used for annotating the code where the name of the routing file is located and returning the name of the routing file to the background;
and the deleting module is used for calling the deleting method provided by the background and deleting the active folder and the configured routing file where the disposable active module is located.
Preferably, the automatic cleaning device for mobile terminal codes further comprises:
the code segmentation module is used for carrying out code segmentation on the active codes to form a plurality of asynchronous blocks, wherein the asynchronous blocks comprise disposable active blocks and conventional active blocks;
the code packaging module is used for packaging each asynchronous block as a file, and the disposable movable blocks are correspondingly packaged into the disposable movable modules;
and the route configuration module is used for configuring an independent route file for each disposable activity module.
The invention also discloses a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program realizes the following steps when being executed by the processor:
invoking a background interface to inquire the activity state of a disposable activity module, wherein the activity state is used for indicating that the disposable activity is in progress or is ended;
if the activity state indicates that the one-time activity is finished, acquiring the name of a routing file configured by the one-time activity module by querying an activity configuration routing page;
annotating a code where the name of the routing file is located, and returning the name of the routing file to the background;
and calling the deleting method provided by the background, and deleting the active folder and the configured routing file where the disposable active module is located.
The present invention also provides a computer readable storage medium having a computer program stored therein, the computer program being executable by at least one processor to implement the steps of:
invoking a background interface to inquire the activity state of a disposable activity module, wherein the activity state is used for indicating that the disposable activity is in progress or is ended;
if the activity state indicates that the one-time activity is finished, acquiring the name of a routing file configured by the one-time activity module by querying an activity configuration routing page;
annotating a code where the name of the routing file is located, and returning the name of the routing file to the background;
and calling the deleting method provided by the background, and deleting the active folder and the configured routing file where the disposable active module is located.
The invention has the positive progress effects that:
1. from the perspective of the mobile terminal, the webpage volume is reduced, the loading speed is increased, the pressure and network loading of a request background are reduced, the process is optimized, and the page can be loaded faster and respond to the operation of the mobile terminal more timely after the optimization.
2. From the background perspective, the optimization can reduce the number of page requests or the bandwidth occupied by the requests, and can save considerable resources.
3. From the code level, through dependency management, the dependency relationship among files can be combed, and the effect of automatically cleaning codes is achieved.
Drawings
FIG. 1 is a flowchart of a first embodiment of an automatic cleaning method for mobile end code according to the present invention;
FIG. 2 is a flow chart of a second embodiment of an automatic cleaning method for mobile end code according to the present invention;
FIG. 3 is a block diagram of a first embodiment of an automatic cleaning device for mobile end code according to the present invention;
FIG. 4 is a block diagram of a second embodiment of the automatic cleaning device for mobile end code of the present invention;
FIG. 5 is a block diagram of a third embodiment of an automatic cleaning device for mobile end code according to the present invention;
FIG. 6 is a schematic diagram of a hardware architecture of an embodiment of a computer device according to the present invention.
Detailed Description
The invention is further illustrated by means of the following examples, which are not intended to limit the scope of the invention.
Firstly, the invention provides an automatic cleaning method for mobile terminal codes.
In a first embodiment, as shown in fig. 1, the method for automatically cleaning the mobile terminal code includes the following steps:
step 10: and calling a background interface to inquire the activity state of the disposable activity module, wherein the activity state is used for indicating that the disposable activity is in progress or is ended.
The mobile terminal mainly refers to a program facing a user, and the background is a program corresponding to the mobile terminal and used for managing and responding to a series of operations of the mobile terminal.
The activity state is determined according to the operation requirement, and the starting time and the ending time of the activity are configured in an activity management system (the activity management system is an on-line system for managing various activities, and the configuration information of the activities is input into the system to realize the management and node monitoring of the various activities). For example, the active state corresponding to the ongoing activity is "put on shelf", and the active state corresponding to the completed activity is "put off shelf". When the activity end time is reached, the activity state in the activity management system is changed from 'on-shelf' to 'off-shelf', and the activity management system returns to the 'off-shelf' state to the background.
In order to realize timely calling the background to inquire the activity state of the disposable activity module, a timer is required to be set at the mobile terminal, the background is specifically inquired in a monitoring mode by setting the timer to inquire the frequency of calling the background interface once every three seconds, for example.
Step 20: judging whether the activity state indicates that the one-time activity is in progress or is ended, and if the one-time activity is in progress, executing the step 10; if so, step 30 is performed.
If the background queries that the activity status is "off the shelf", it indicates that the activity is finished, and cleaning needs to be started at this time, that is, step 30 is executed. If the active state is "put on shelf", step 10 is repeated until the active state is "put off shelf", step 30 is not performed.
Step 30: and inquiring the active configuration routing page to acquire the name of the routing file configured by the disposable active module.
The mobile terminal searches the name of the routing file corresponding to the disposable active module in the active configuration routing page, specifically, the address of the input page jumps to the corresponding active configuration routing page, the name of the disposable active module and the name of the routing file corresponding to the configuration are displayed on the page, and the name of the corresponding routing file is found through the name of the disposable active module.
Step 40: annotating the code where the name of the routing file is located, and returning the name of the routing file to the background.
After the name of the routing file is queried, the mobile terminal calls a keyboard shortcut key (mac: command+/and window: ctrl+ /) to automatically annotate the name of the routing file, namely annotate and shield codes where the name of the routing file is located, for example// { path: 'activityName' }, namely annotation.
The automatic annotation code here needs to read a file (this file contains an initial code of the name of the routing file), for example, xx.js file, into a file stream, then convert it into a character string, then regularly judge which segment of the character string needs to be deleted, and then convert the processed character string into a file stream to write (overlay) to xx.js. The specific steps are as follows:
step 41: reading a file containing the initial code of the name of the routing file into an initial file stream and converting the initial file stream into a character string;
step 42: searching a character string segment representing the name of the routing file in the character string through regular judgment;
step 43: marking the searched character string fragments in the character string, wherein the marking comprises the steps of respectively inserting markers at the head and the tail of the character string fragments;
step 44: converting the character string with the label into an updated file stream;
step 45: and writing the updated file stream into the file to cover the initial code.
The names of the routing files in the code need to be deleted later, so that the queried names of the routing files need to be returned to the background.
Step 50: and calling the deleting method provided by the background, and deleting the active folder and the configured routing file where the disposable active module is located.
The deleting method is preset in the background, when the one-time movable falling off is determined, the mobile terminal automatically calls the deleting method of the background, the corresponding path and the file name of the file are transmitted to the background, and the background deletes the movable folder and the routing file.
The mobile terminal sets a timer to call a background interface to inquire the active state, calls a keyboard event of the mobile terminal or reads a file to obtain a file object, and the file object can be deleted by a preset deletion method corresponding to the file object. The method is characterized in that the background provides a deleting method for the mobile terminal to call, the path and the file name of the corresponding file are transmitted to the background, and the background deletes the movable file folder and the routing file. The deletion method may be a piece of code simulating manual deletion, or a deletion instruction code corresponding to each file object.
The movable file folder stores disposable movable codes and pictures, and after the movable file folder is put on shelf, the codes and pictures are useless, and the whole file folder is quickly deleted and cleaned by calling a background deleting method. The names of the routing files in the codes are annotated in advance, specifically through a marker "//", for example, so that the names of the corresponding routing files can be deleted rapidly after the marker "//", namely the deletion of the configured routing files is completed. In the code, the configuration of the routing file is represented by { path: 'actyName' }, and the routing file can be distinguished after the marker is queried.
In addition, in order to record the past disposable activity, the activity folder and the configured routing file where the disposable activity module is located are preferably deleted, and meanwhile, the routing file and the related information of the disposable activity are stored in an array queue for later viewing and statistics.
According to the method, for the mobile terminal, the webpage volume is reduced, the loading speed is increased, the pressure and network loading of the request background are reduced, the process is optimized, and after optimization, the page can be loaded faster and the operation response to the mobile terminal is more timely. For the background, the optimization can reduce the number of page requests or the bandwidth occupied by the requests, and can save considerable resources.
In a second embodiment, based on the first embodiment, as shown in fig. 2, the automatic cleaning method of the mobile terminal code includes the following steps:
step 01: the active code is code partitioned to form a number of asynchronous blocks, including a disposable active block and a regular active block.
Code cleaning is here aimed at a one-time activity, so that after the code is completed, the activity code needs to be split first to distinguish. The activity codes are divided into two types, one is a regular activity and the other is a disposable activity; by regular activities is meant modules that can be applied to operation and configuration at all times, not to be pruned, whereas disposable activities are mostly things that are applied on each holiday, and will not be reused after the end.
Code splitting may be implemented by a code splitting tool (e.g., weback), and after code splitting, new blocks are formed, and asynchronous dependencies are adopted between the blocks.
Step 02: and packaging each asynchronous block as a file, wherein the disposable active blocks are correspondingly packaged into the disposable active modules.
After optimizing the dependency tree among the blocks, each asynchronous block is taken as a file to be packed, the disposable active block corresponds to the disposable active module, and the conventional active block corresponds to the conventional active module.
Step 03: and configuring a separate routing file for each disposable activity module.
To facilitate the putting down of the disposable activity modules, each disposable activity module is configured with a separate routing file, for example, a tool weback may be configured in a package json, where the package json is used to define various modules required by the project, and configuration information (such as name, version, license, and other metadata) of the project, where the project corresponds to the activity in this embodiment.
Next, the present invention proposes an automatic cleaning device for mobile end codes, said device 20 being able to be divided into one or more modules.
For example, fig. 3 shows a block diagram of a first embodiment of the automatic cleaning device 20 for mobile end code, in which the device 20 may be divided into a status query module 201, a route query module 202, an annotation module 203, and a deletion module 204. The following description will specifically introduce specific functions of the modules 201-204.
The status query module 201 is configured to invoke a background interface to query an activity status of a disposable activity module, where the activity status is used to indicate that the disposable activity is in progress or has ended.
The activity state is determined according to the operation requirement, and the starting time and the ending time of the activity are configured in an activity management system (the activity management system is an on-line system for managing various activities, and the configuration information of the activities is input into the system to realize the management and node monitoring of the various activities). For example, the active state corresponding to the ongoing activity is "put on shelf", and the active state corresponding to the completed activity is "put off shelf". When the activity end time is reached, the activity state in the activity management system is changed from 'on-shelf' to 'off-shelf', and the activity management system returns to the 'off-shelf' state to the background.
In order to realize timely calling the background to inquire the activity state of the disposable activity module, a timer is required to be set at the mobile terminal, the background is specifically inquired in a monitoring mode by setting the timer to inquire the frequency of calling the background interface once every three seconds, for example.
The route query module 202 is configured to, when the activity status indicates that the one-time activity is finished, configure a route page by querying an activity to obtain a name of a route file configured by the one-time activity module.
If the background inquires that the activity state is "off the shelf", the background indicates that the activity is finished, and cleaning is required to be started at the moment, namely the mobile terminal searches the name of the route file corresponding to the disposable activity module in the activity configuration route page.
The annotation module 203 is configured to annotate a code where the name of the routing file is located, and return the name of the routing file to the background.
After the name of the routing file is queried, the mobile terminal calls a keyboard shortcut key (mac: command+/and window: ctrl+ /) to automatically annotate the name of the routing file, namely annotate and shield codes where the name of the routing file is located, for example// { path: 'activityName' }, namely annotation.
The automatic annotation code needs to read a file, such as an xx.js file, into a file stream, then convert the file stream into a character string, judge which segment in the character string needs to be deleted regularly, and then convert the processed character string into the file stream to write (cover) the file stream to xx.js.
The names of the routing files in the code need to be deleted later, so that the queried names of the routing files need to be returned to the background.
The deletion module 204 is configured to invoke the deletion method provided by the background, and delete the active folder and the configured routing file where the disposable active module is located.
The deleting method is preset in the background, when the one-time movable falling off is determined, the mobile terminal automatically calls the deleting method of the background, the corresponding path and the file name of the file are transmitted to the background, and the background deletes the movable folder and the routing file.
The mobile terminal sets a timer to call a background interface to inquire the active state, calls a keyboard event of the mobile terminal or reads a file to obtain a file object, and the file object can be deleted by a preset deletion method corresponding to the file object. The method is characterized in that the background provides a deleting method for the mobile terminal to call, the path and the file name of the corresponding file are transmitted to the background, and the background deletes the movable file folder and the routing file.
The movable file folder stores disposable movable codes and pictures, and after the movable file folder is put on shelf, the codes and pictures are useless, and the whole file folder is quickly deleted and cleaned by calling a background deleting method. The names of the routing files in the code are annotated in advance, specifically by e.g. '// ', so that the corresponding routing files can be quickly deleted by looking for the "///'" in the code.
As another example, fig. 4 shows a block diagram of a second embodiment of the automatic cleaning device 20 for mobile end codes, where the automatic cleaning device 20 for mobile end codes may be further divided into a status query module 201, a route query module 202, an annotation module 203, a deletion module 204, a code division module 205, a code packaging module 206, and a route configuration module 207.
The modules 201-204 are the same as the first embodiment, and will not be described here again.
The code division module 205 is configured to code-divide the active code to form a plurality of asynchronous blocks, where the asynchronous blocks include a disposable active block and a regular active block.
Code cleaning is here aimed at a one-time activity, so that after the code is completed, the activity code needs to be split first to distinguish. The activity codes are divided into two types, one is a regular activity and the other is a disposable activity; by regular activities is meant modules that can be applied to operation and configuration at all times, not to be pruned, whereas disposable activities are mostly things that are applied on each holiday, and will not be reused after the end.
The code packaging module 206 is configured to package each of the asynchronous blocks as a file, and the disposable active blocks are correspondingly packaged into the disposable active modules.
After optimizing the dependency tree among the blocks, each asynchronous block is taken as a file to be packed, the disposable active block corresponds to the disposable active module, and the conventional active block corresponds to the conventional active module.
The route configuration module 207 is configured to configure each of the disposable activity modules with a separate one of the route files.
To facilitate the off-shelf of disposable activity modules, each disposable activity module is configured with a separate routing file.
For another example, fig. 5 shows a block diagram of a third embodiment of the automatic cleaning apparatus 20 for mobile end codes, where the automatic cleaning apparatus 20 for mobile end codes may be further divided into a status query module 201, a route query module 202, an annotation module 203, a deletion module 204, a code division module 205, a code packaging module 206, a route configuration module 207, and a storage module 208.
The modules 201-207 are the same as the second embodiment, and will not be described again here.
The storage module 208 is configured to store the route file and the related information of the one-time activity in an array queue.
The routing file and the related information of the disposable activity are stored in an array queue, so that the routing file is convenient to view and count in the future.
The invention further provides computer equipment.
Fig. 6 is a schematic diagram of a hardware architecture of an embodiment of a computer device according to the present invention. In this embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction. For example, it may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including a stand-alone server or a server cluster composed of a plurality of servers), etc. As shown, the computer device 2 includes, but is not limited to, at least a memory 21, a processor 22, and a network interface 23 communicatively coupled to each other via a system bus. Wherein:
the memory 21 includes at least one type of computer-readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 2. Of course, the memory 21 may also comprise both an internal memory unit of the computer device 2 and an external memory device. In this embodiment, the memory 21 is generally used to store an operating system and various application software installed on the computer device 2, such as a computer program for implementing an automatic cleaning method for the mobile terminal code. Further, the memory 21 may be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2, such as performing control and processing related to data interaction or communication with the computer device 2. In this embodiment, the processor 22 is configured to execute a program code or process data stored in the memory 21, for example, execute a computer program for implementing an automatic cleaning method of the mobile terminal code.
The network interface 23 may comprise a wireless network interface or a wired network interface, which network interface 23 is typically used for establishing a communication connection between the computer device 2 and other computer devices. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, GSM), wideband code division multiple access (Wideband Code DivisionMultiple Access, WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, or other wireless or wired network.
It is noted that fig. 5 only shows a computer device 2 having components 21-23, but it is understood that not all of the illustrated components are required to be implemented, and that more or fewer components may alternatively be implemented.
In this embodiment, the computer program stored in the memory 21 for implementing the automatic cleaning method of the mobile terminal code may be executed by one or more processors (the processor 22 in this embodiment) to perform the following steps:
step 10: invoking a background interface to inquire the activity state of a disposable activity module, wherein the activity state is used for indicating that the disposable activity is in progress or is ended;
step 20: judging whether the activity state indicates that the one-time activity is in progress or is ended, and if the one-time activity is in progress, executing the step 10; if so, executing step 30;
step 30: the route page is configured through inquiring the activity so as to obtain the name of the route file configured by the disposable activity module;
step 40: annotating a code where the name of the routing file is located, and returning the name of the routing file to the background;
step 50: and calling the deleting method provided by the background, and deleting the active folder and the configured routing file where the disposable active module is located.
Furthermore, the invention provides a computer readable storage medium, which is a nonvolatile readable storage medium, and a computer program is stored in the computer readable storage medium, and the computer program can be executed by at least one processor to realize the operation of the automatic cleaning method or the device of the mobile terminal code.
Among them, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the computer readable storage medium may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash memory Card (Flash Card), etc. that are provided on the computer device. Of course, the computer-readable storage medium may also include both internal storage units of a computer device and external storage devices. In this embodiment, the computer readable storage medium is typically used to store an operating system and various types of application software installed on a computer device, such as a computer program for implementing the automatic cleaning method of the mobile end code. Furthermore, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the principles and spirit of the invention, but such changes and modifications fall within the scope of the invention.

Claims (7)

1. An automatic cleaning method for mobile terminal codes is characterized by comprising the following steps:
invoking a background interface to inquire the activity state of a disposable activity module, wherein the activity state is used for indicating that the disposable activity is in progress or is ended;
if the activity state indicates that the one-time activity is finished, acquiring the name of a routing file configured by the one-time activity module by querying an activity configuration routing page;
annotating a code where the name of the routing file is located, and returning the name of the routing file to the background;
invoking a deleting method provided by the background, and deleting an active folder and a configured routing file where the disposable active module is located;
before the call background interface queries the activity state of the disposable activity module, the method further comprises the following steps:
code segmentation is carried out on the active codes to form a plurality of asynchronous blocks, wherein the asynchronous blocks comprise disposable active blocks and conventional active blocks;
packing each asynchronous block as a file, and correspondingly packing the disposable movable blocks into the disposable movable modules;
configuring a separate routing file for each of the disposable activity modules;
the annotation comprises the steps of:
reading a file containing the initial code of the name of the routing file into an initial file stream and converting the initial file stream into a character string;
searching a character string segment representing the name of the routing file in the character string through regular judgment;
marking the searched character string fragments in the character string, wherein the marking comprises the steps of respectively inserting markers at the head and the tail of the character string fragments;
converting the character string fragments with the labels into an updated file stream;
and writing the updated file stream into the file to cover the initial code.
2. The method according to claim 1, wherein the background queries the activity status of the disposable activity module by listening to a timed task.
3. The method for automatically cleaning up a mobile terminal code according to claim 1, wherein the step of deleting the active folder and the configured routing file in which the disposable active module is located includes the steps of:
and storing the routing file and the related information of the disposable activity into an array queue.
4. The method for automatically cleaning up a mobile terminal code according to claim 1, wherein the deletion of the routing file comprises the steps of:
searching the code of the file for the marker;
and deleting codes representing names of the routing files after the markers.
5. An automatic cleaning device for mobile terminal codes, comprising:
the state query module is used for calling the background interface to query the activity state of the disposable activity module, wherein the activity state is used for indicating that the disposable activity is in progress or is ended;
the route inquiry module is used for inquiring an activity configuration route page to acquire the name of a route file configured by the disposable activity module when the activity state indicates that the disposable activity is finished;
the annotation module is used for annotating the code where the name of the routing file is located and returning the name of the routing file to the background;
the deleting module is used for calling the deleting method provided by the background and deleting the active folder and the configured routing file where the disposable active module is located;
the code segmentation module is used for carrying out code segmentation on the active codes to form a plurality of asynchronous blocks, wherein the asynchronous blocks comprise disposable active blocks and conventional active blocks;
the code packaging module is used for packaging each asynchronous block as a file, and the disposable movable blocks are correspondingly packaged into the disposable movable modules;
a route configuration module, configured to configure each of the disposable active modules with an individual route file;
the annotation comprises:
reading a file containing the initial code of the name of the routing file into an initial file stream and converting the initial file stream into a character string;
searching a character string segment representing the name of the routing file in the character string through regular judgment;
marking the searched character string fragments in the character string, wherein the marking comprises the steps of respectively inserting markers at the head and the tail of the character string fragments;
converting the character string fragments with the labels into an updated file stream;
and writing the updated file stream into the file to cover the initial code.
6. A computer device comprising a memory and a processor, characterized in that the memory has stored thereon a computer program which, when executed by the processor, implements the steps of the automatic cleaning method of mobile end code according to any of claims 1-4.
7. A computer readable storage medium, having stored therein a computer program executable by at least one processor to implement the steps of the automatic cleaning method of mobile end code as recited in any one of claims 1-4.
CN202010590146.1A 2020-06-24 2020-06-24 Automatic cleaning method, device and equipment for mobile terminal codes and storage medium Active CN111722874B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010590146.1A CN111722874B (en) 2020-06-24 2020-06-24 Automatic cleaning method, device and equipment for mobile terminal codes and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010590146.1A CN111722874B (en) 2020-06-24 2020-06-24 Automatic cleaning method, device and equipment for mobile terminal codes and storage medium

Publications (2)

Publication Number Publication Date
CN111722874A CN111722874A (en) 2020-09-29
CN111722874B true CN111722874B (en) 2024-04-02

Family

ID=72568840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010590146.1A Active CN111722874B (en) 2020-06-24 2020-06-24 Automatic cleaning method, device and equipment for mobile terminal codes and storage medium

Country Status (1)

Country Link
CN (1) CN111722874B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019051680A1 (en) * 2017-09-13 2019-03-21 深圳传音通讯有限公司 Smart terminal-based application program optimization method and optimization system
CN109918076A (en) * 2017-12-13 2019-06-21 北京嘀嘀无限科技发展有限公司 Code file processing method, system, computer equipment and readable storage medium storing program for executing
US10459697B1 (en) * 2018-05-03 2019-10-29 Microsoft Technology Licensing, Llc Difference view mode for integrated development environments
CN110399132A (en) * 2019-06-18 2019-11-01 平安科技(深圳)有限公司 Maintaining method, device, computer equipment and the storage medium of item code

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9286035B2 (en) * 2011-06-30 2016-03-15 Infosys Limited Code remediation
JP2014044490A (en) * 2012-08-24 2014-03-13 Toshiba Corp Host device and memory device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019051680A1 (en) * 2017-09-13 2019-03-21 深圳传音通讯有限公司 Smart terminal-based application program optimization method and optimization system
CN109918076A (en) * 2017-12-13 2019-06-21 北京嘀嘀无限科技发展有限公司 Code file processing method, system, computer equipment and readable storage medium storing program for executing
US10459697B1 (en) * 2018-05-03 2019-10-29 Microsoft Technology Licensing, Llc Difference view mode for integrated development environments
CN110399132A (en) * 2019-06-18 2019-11-01 平安科技(深圳)有限公司 Maintaining method, device, computer equipment and the storage medium of item code

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Implementing a Systematic Approach to Improve Governance and Deployment of Imaging Codes in Radiology;Carolina V. Guimaraes等;《Current Problems in Diagnostic Radiology》;20180718;第47卷(第04期);215-219 *

Also Published As

Publication number Publication date
CN111722874A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN111198856B (en) File management method, device, computer equipment and storage medium
WO2018129774A1 (en) Method and device for page processing
CN104331428B (en) The storage of a kind of small documents and big file and access method
CN110347651A (en) Method of data synchronization, device, equipment and storage medium based on cloud storage
CN113343045B (en) Data caching method and network equipment
CN110990356A (en) Real-time automatic capacity expansion method and system for logical mirror image
CN117632860A (en) Method and device for merging small files based on Flink engine and electronic equipment
CN115599790B (en) Data storage system, data processing method, electronic equipment and storage medium
CN112597151A (en) Data processing method, device, equipment and storage medium
CN114089912B (en) Data processing method and device based on message middleware and storage medium
CN114637499B (en) Visualization component processing method, device, equipment and medium
US10628305B2 (en) Determining a data layout in a log structured storage system
CN111722874B (en) Automatic cleaning method, device and equipment for mobile terminal codes and storage medium
US8832176B1 (en) Method and system for processing a large collection of documents
CN107450859B (en) Method and device for reading file data
CN110941605A (en) Method and device for deleting repeated data on line and readable storage medium
KR101744017B1 (en) Method and apparatus for indexing data for real time search
CN111782588A (en) File reading method, device, equipment and medium
CN113111059B (en) Data storage management method and device
CN116303125B (en) Request scheduling method, cache, device, computer equipment and storage medium
CN118708384B (en) Method and system for optimizing GPU remote call performance based on pre-analysis and calculation service
CN118760659B (en) File loading method, device, electronic equipment and storage medium
CN119646335A (en) Image loading method, electronic device, storage medium and program product
CN119902785A (en) Application upgrade method, device, equipment and storage medium in embedded smart card
CN120386490A (en) A data management method, system, device and medium under high concurrent write operation

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
GR01 Patent grant
GR01 Patent grant