CN114860340A - Starting control method, device, equipment and storage medium for configuring logic code - Google Patents

Starting control method, device, equipment and storage medium for configuring logic code Download PDF

Info

Publication number
CN114860340A
CN114860340A CN202210540185.XA CN202210540185A CN114860340A CN 114860340 A CN114860340 A CN 114860340A CN 202210540185 A CN202210540185 A CN 202210540185A CN 114860340 A CN114860340 A CN 114860340A
Authority
CN
China
Prior art keywords
configuration logic
logic code
array
code
target
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
CN202210540185.XA
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.)
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 CN202210540185.XA priority Critical patent/CN114860340A/en
Publication of CN114860340A publication Critical patent/CN114860340A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented

Abstract

The application relates to the field of application development, and discloses a starting control method and device for configuring a logic code, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a configuration logic code of an IOS application program in a starting stage; writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure, and generating an array name corresponding to the configuration logic code; acquiring the execution time of the configuration logic code, and reading a target array in the target data segment according to the array name after the execution time is reached; and converting the target array into an object array, and calling a target function in the object array to execute the configuration logic code. The method and the device can improve the starting efficiency and success rate of the configuration logic code in the IOS application program.

Description

Starting control method, device, equipment and storage medium for configuring logic code
Technical Field
The present application relates to the field of application development, and in particular, to a method and an apparatus for controlling the start of configuration logic codes, a computer device, and a storage medium.
Background
In an IOS application program, some code logic needs to be executed before a program starts to execute business logic, and a common means is to write the code logic in a C + + global constructor or a load function, an IOS system collects the load functions of classes to be automatically executed when the program is initialized, and simultaneously traverses and executes the C + + global constructor, so that the code logic can be executed before the business code logic is executed.
Disclosure of Invention
The present application mainly aims to provide a method and an apparatus for controlling the start-up of a configuration logic code, a computer device, and a storage medium, and aims to solve the problem of low start-up efficiency and success rate of the configuration logic code.
In order to achieve the above object, the present application provides a method for controlling start of configuration logic code, including:
acquiring a configuration logic code of an IOS application program in a starting stage;
writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure, and generating an array name corresponding to the configuration logic code;
acquiring the execution time of the configuration logic code, and reading a target array in the target data segment according to the array name after the execution time is reached;
and converting the target array into an object array, and calling a target function in the object array to execute the configuration logic code.
Further, the obtaining the configuration logic code of the IOS application program starting phase includes:
compiling the engineering code of the IOS application program through a preset compiler;
reading the compiled engineering code;
and determining a code segment containing preset keywords in the compiled engineering code as a configuration logic code of the IOS application program in a starting stage.
Further, the writing the configuration logic code into a target data segment of an executable file of the IOS application in a preset array structure includes:
acquiring the type of an array structure;
if the type is a Function type, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a Function form, and generating a pointer Function for executing the configuration logic code;
and if the type is a block type, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a block form, and generating an anonymous function for executing the configuration logic code.
Further, the converting the target array into an object array and calling a target function in the object array to execute the configuration logic code further includes:
converting the target array into an object array, and calling a pointer function in the object array to execute the configuration logic code; or the like, or, alternatively,
and converting the target array into an object array, and calling an anonymous function in the object array to execute the configuration logic code.
Further, after writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure and generating an array name corresponding to the configuration logic code, the method further includes:
acquiring the priority of each configuration logic code;
adding an execution sequence field in the target data segment, and configuring the field value of the execution sequence field according to the priority so as to configure the execution sequence of the configuration logic code.
Further, the invoking a target function in the object array to execute the configuration logic code comprises:
and acquiring an execution sequence of the configuration logic code, and calling a target function in the object array according to the execution sequence to execute the configuration logic code.
Further, before the obtaining the execution time of the configuration logic code, the method further includes:
acquiring function information associated with the configuration logic code;
acquiring starting time and starting frequency of the function information;
and generating the execution time of the configuration logic code according to the starting time and the starting frequency.
The present application also provides a start control device for configuring a logic code, including:
the information acquisition module is used for acquiring the configuration logic code of the IOS application program in the starting stage;
the data storage module is used for writing the configuration logic codes into a target data segment of an executable file of the IOS application program in a preset array structure and generating an array name corresponding to the configuration logic codes;
the execution response module is used for acquiring the execution time of the configuration logic code and reading the target array in the target data segment according to the array name after the execution time is reached;
and the control execution module is used for converting the target array into an object array and calling a target function in the object array to execute the configuration logic code.
The present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the start control method for configuring logic codes according to any one of the above descriptions when executing the computer program.
The present application also provides a computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for controlling the start of configuring logic code according to any one of the above.
The application provides a method for executing configuration logic codes in an IOS application program in a self-defined manner, the code logic of a program starting stage is written into a target DATA segment of an executable file of the application program and then is taken out to be executed at the time needing to be executed, firstly, the configuration logic codes of the IOS application program starting stage are obtained, the configuration logic codes are written into the target DATA segment of the executable file of the IOS application program in a preset array structure, a number group name corresponding to the configuration logic codes is generated, the target DATA segment is a __ DATA segment of the executable file, the corresponding configuration logic codes can be positioned through the number group name, the execution time of the configuration logic codes is obtained, after the execution time is reached, a target array in the target DATA segment is read according to the number group name, and screening is carried out through the number group name, the corresponding configuration logic code can be positioned, the target array is converted into the object array, the target function in the object array is called to execute the configuration logic code, the execution time of the configuration logic code is self-determined, automatic execution in the initialization stage of the application program is avoided, the time of the program starting stage can be reduced, meanwhile, the configuration logic code segment needing to be executed is stored in an array mode and is executed after the execution time is resolved, the problem that the configuration logic code is covered is solved, and the starting efficiency and the success rate of the configuration logic code are improved.
Drawings
FIG. 1 is a flowchart illustrating an embodiment of a method for controlling the start of configuration logic according to the present application;
FIG. 2 is a schematic structural diagram illustrating an embodiment of a start control apparatus configured with logic codes according to the present application;
FIG. 3 is a block diagram illustrating a computer device according to an embodiment of the present invention.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, an embodiment of the present application provides a startup control method for configuring logic codes, including steps S10-S40, and details of each step of the startup control method for configuring logic codes are described as follows.
And S10, acquiring the configuration logic code of the IOS application program starting phase.
The embodiment is applied to an execution control scenario of a configuration logic code before a service logic code is executed in an IOS application program, in the application program, a part of the logic code needs to be executed before the service logic code, the part of the logic code is defined as the configuration logic code, and the configuration logic code includes corresponding logic codes such as method exchange, routing configuration initialization and the like. In order to reasonably control the configuration logic codes in the IOS application program, including allocating the starting time of different configuration logic codes, firstly, acquiring the configuration logic codes in the starting stage of the IOS application program, and in one embodiment, acquiring the configuration logic codes by pre-dotting the configuration logic codes and identifying the dotting; in another embodiment, when the configuration logic code of the IOS application is not modified, the method function in which the startup phase of the IOS application participates is obtained as the configuration logic code.
And S20, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure, and generating an array name corresponding to the configuration logic code.
In this embodiment, after obtaining the configuration logic code at the IOS application startup stage, it is necessary to autonomously control the startup of the configuration logic code, that is, to autonomously control the execution time of different configuration logic codes, specifically, write the configuration logic code into the target DATA segment of the executable file of the IOS application in a preset array structure, that is, store the configuration logic code into the executable file in an array form, specifically store the configuration logic code into the target DATA segment of the executable file in an array form, where the target DATA segment is __ DATA segment of the executable file, and generate a array name corresponding to the configuration logic code, and the corresponding configuration logic code can be located by the array name, and in an implementation manner, each configuration logic code is converted into a corresponding sub-array for storage, and integrating the different sub-arrays, configuring corresponding array names, and generating the array names corresponding to the configuration logic codes.
S30, obtaining the execution time of the configuration logic code, and reading the target array in the target data segment according to the array name after the execution time is reached.
In this embodiment, after writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure and generating an array name corresponding to the configuration logic code, an execution time of the configuration logic code is obtained, where the execution time may be an execution time of a different configuration logic code that is preset or an execution time determined based on a function of the configuration logic code, and in one embodiment, the execution time of the configuration logic code is stored in an array in association with the configuration logic code, and after the execution time is reached, a target array in the target data segment is read according to the array name. Specifically, in the using process of the application program, if the configuration logic code is required to be executed, the execution time is determined to be reached, then the target array in the target data segment is read according to the array name, and as different configuration logic codes are stored in the target data segment, the corresponding configuration logic code, namely the target array, can be located by screening through the array name.
S40, converting the target array into an object array, and calling a target function in the object array to execute the configuration logic code.
In this embodiment, after the execution time of the configuration logic code is obtained, and after the execution time is reached, the target array in the target data segment is read according to the array name, the target array is converted into the object array, that is, the data in the target array is taken out, then the data is converted into the object, then the object array is traversed, and the target function for calling the configuration logic code is determined from the object array, so that the configuration logic code is executed by using the target function in the object array, the execution time of the configuration logic code is determined by itself, and the automatic execution in the initialization stage of the application program is avoided, so that the time of the program start stage can be reduced, and meanwhile, the configuration logic code segment to be executed is stored in an array manner and is executed after the execution time is reached, the problem that the configuration logic code is covered is solved, and therefore the starting efficiency and the success rate of the configuration logic code are improved.
The embodiment provides a method for executing configuration logic codes in an IOS application program in a customized manner, which includes writing code logic in a program starting stage into a target DATA segment of an application program executable file, and then taking out the code logic at a time needing to be executed, first obtaining configuration logic codes in the IOS application program starting stage, writing the configuration logic codes into the target DATA segment of the executable file of the IOS application program in a preset array structure, and generating a array name corresponding to the configuration logic codes, wherein the target DATA segment is a __ DATA segment of the executable file, the array name can be used for locating corresponding configuration logic codes, the execution time of the configuration logic codes is obtained, after the execution time is reached, a target array in the target DATA segment is read according to the array name, and screening is performed according to the array name, the corresponding configuration logic code can be positioned, the target array is converted into the object array, the target function in the object array is called to execute the configuration logic code, the execution time of the configuration logic code is self-determined, automatic execution in the initialization stage of the application program is avoided, the time of the program starting stage can be reduced, meanwhile, the configuration logic code segment needing to be executed is stored in an array mode and is executed after the execution time is resolved, the problem that the configuration logic code is covered is solved, and the starting efficiency and the success rate of the configuration logic code are improved.
In one embodiment, the obtaining the configuration logic code of the IOS application startup phase includes:
compiling the engineering code of the IOS application program through a preset compiler;
reading the compiled engineering code;
and determining a code segment containing preset keywords in the compiled engineering code as a configuration logic code of the IOS application program in a starting stage.
In this embodiment, in the process of obtaining the configuration logic code at the IOS application start stage, in order to improve the efficiency of automatic search and configuration of the configuration logic code, the engineering code of the IOS application is compiled by a preset compiler to obtain the engineering code of the compiled IOS application, then the compiled engineering code is read, and then the compiled engineering code is searched, a code fragment containing a preset keyword in the compiled engineering code is determined as the configuration logic code at the IOS application start stage, the preset keyword is an attribute keyword, a code fragment containing attribute is determined as the configuration logic code at the IOS application start stage, specifically, the attribute keyword is read by the compiler during compiling, a code containing the keyword in the compiled engineering code is a configuration logic code, for example, codes which include attribute keywords in compiled engineering codes are identified as __ attribute __ ((used, section ("__ DATA, __ pacx _ func"))), __ attribute __ ((used, section ("__ DATA, __ pacx _ block")), and the logic codes are determined to be in a form that configuration logic codes are rewritten into a target DATA segment, so that applicability in different application programs is improved, and efficiency of obtaining the configuration logic codes is improved.
In one embodiment, the writing the configuration logic code into a target data segment of an executable file of the IOS application in a preset array structure includes:
acquiring the type of an array structure;
if the type is a Function type, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a Function form, and generating a pointer Function for executing the configuration logic code;
and if the type is a block type, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a block form, and generating an anonymous function for executing the configuration logic code.
In this embodiment, in the process of writing the configuration logic code into the target data segment of the executable file of the IOS application in the preset array structure, since the data structure includes a plurality of different types and the data structure types used by the application developed by different enterprises are different, in order to adapt to different actual development scenarios, the type of the array structure is first obtained, in this embodiment, two array structure types commonly called in the IOS application are defined, including a Function type and a block type, and if the type is the Function type, the configuration logic code is written into the target data segment of the executable file of the IOS application in the Function form, and a pointer Function for executing the configuration logic code is generated, that is, an address for executing the code logic is configured into a funptr pointer, and a pointer Function for executing the configuration logic code is generated; and if the type is a block type, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a block form, and generating an anonymous function for executing the configuration logic code, namely setting an executed closure code to assign to the block, thereby configuring different array structures to store the configuration logic code and improving the applicability of an actual development scene.
In one embodiment, the converting the target array into an object array and calling a target function in the object array to execute the configuration logic code includes:
converting the target array into an object array, and calling a pointer function in the object array to execute the configuration logic code; or the like, or, alternatively,
and converting the target array into an object array, and calling an anonymous function in the object array to execute the configuration logic code.
In this embodiment, in the process of converting the target array into the object array and calling the target Function in the object array to execute the configuration logic code, since different data structures configure different calling methods of the logic configuration code, when an array structure is a Function type, the target array is converted into the object array and a pointer Function in the object array is called to execute the configuration logic code, and/or, when the array structure is a block type, the target array is converted into the object array and an anonymous Function in the object array is called to execute the configuration logic code. In one embodiment, the data and the data size of the original configuration logic code are acquired by introducing a corresponding array name through a 'getselectiondata' function, then the data and the data size are converted into a Funtion object array or a Block object array through data type conversion, if the data and the Block object array are converted into the Funtion object array, a pointer function in the object array is called to execute the configuration logic code, and if the data and the Block object array are converted into the Block object array, an anonymous function in the object array is called to execute the configuration logic code, so that different array structures are configured to execute the configuration logic code stored in different array structures, and the applicability of an actual development scene is improved.
In one embodiment, after writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure and generating an array name corresponding to the configuration logic code, the method further includes:
acquiring the priority of each configuration logic code;
adding an execution sequence field in the target data segment, and configuring the field value of the execution sequence field according to the priority so as to configure the execution sequence of the configuration logic code.
In this embodiment, after writing the configuration logic codes into a target data segment of an executable file of the IOS application program in a preset array structure and generating an array name corresponding to the configuration logic codes, obtaining a priority of each of the configuration logic codes, where the priority may be determined by a function level of the configuration logic codes, and then adding an execution sequence field in the target data segment, where the execution sequence field may be a priority field, and configuring a field value of the priority field according to the priority to configure an execution sequence of the configuration logic codes, so that the execution sequence of different logic configuration codes may be customized, and resources may be reasonably allocated, thereby improving efficiency and success rate of executing the logic configuration codes.
In one embodiment, said calling a target function in said object array to execute said configuration logic code comprises:
and acquiring an execution sequence of the configuration logic code, and calling a target function in the object array according to the execution sequence to execute the configuration logic code.
In this embodiment, in the process of calling the target function in the object array to execute the configuration logic code, an execution sequence of the configuration logic code is obtained, the target function in the object array is called according to the execution sequence to execute the configuration logic code, that is, when the target function in the object array is called to execute the configuration logic code, the execution sequence is obtained, the target function in the object array is called according to the execution sequence to execute the configuration logic code, the execution sequence of different logic configuration codes can be customized, resources are reasonably allocated, and thus, the efficiency and the success rate of executing the logic configuration code are improved.
In one embodiment, before the obtaining the execution time of the configuration logic code, the method further includes:
acquiring function information associated with the configuration logic code;
acquiring starting time and starting frequency of the function information;
and generating the execution time of the configuration logic code according to the starting time and the starting frequency.
In this embodiment, before the execution time of the configuration logic code is obtained, the execution times of different configuration logic codes need to be determined, specifically, function information associated with the configuration logic code, that is, which service function the configuration logic code is associated with, needs to be started before the service function is executed, then the start time and the start frequency of the function information are obtained, statistics is performed according to big data, and the execution time of the configuration logic code is generated based on the start time and the start frequency of the function information, so that the execution times of different configuration logic codes are dynamically configured based on the big data, and the reasonability of the execution time of the logic configuration code is improved.
Referring to fig. 2, the present application also provides a startup control device for configuring logic codes, including:
an information obtaining module 10, configured to obtain a configuration logic code at an IOS application program starting stage;
a data storage module 20, configured to write the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure, and generate an array name corresponding to the configuration logic code;
an execution response module 30, configured to obtain an execution time of the configuration logic code, and read a target array in the target data segment according to the array name after the execution time is reached;
and the control execution module 40 is configured to convert the target array into an object array, and call a target function in the object array to execute the configuration logic code.
As described above, it is understood that the components of the start control apparatus for configuring logic codes proposed in the present application may implement the functions of any of the start control methods for configuring logic codes as described above.
In one embodiment, the obtaining the configuration logic code of the IOS application startup phase includes:
compiling the engineering code of the IOS application program through a preset compiler;
reading the compiled engineering code;
and determining a code segment containing preset keywords in the compiled engineering code as a configuration logic code of the IOS application program in a starting stage.
In one embodiment, the writing the configuration logic code into a target data segment of an executable file of the IOS application in a preset array structure includes:
acquiring the type of an array structure;
if the type is a Function type, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a Function form, and generating a pointer Function for executing the configuration logic code;
and if the type is a block type, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a block form, and generating an anonymous function for executing the configuration logic code.
In one embodiment, the converting the target array into an object array and calling a target function in the object array to execute the configuration logic code includes:
converting the target array into an object array, and calling a pointer function in the object array to execute the configuration logic code; or the like, or, alternatively,
and converting the target array into an object array, and calling an anonymous function in the object array to execute the configuration logic code.
In one embodiment, after writing the configuration logic code into a target data segment of an executable file of the IOS application in a preset array structure and generating an array name corresponding to the configuration logic code, the method further includes:
acquiring the priority of each configuration logic code;
adding an execution sequence field in the target data segment, and configuring the field value of the execution sequence field according to the priority so as to configure the execution sequence of the configuration logic code.
In one embodiment, said calling a target function in said object array to execute said configuration logic code comprises:
and acquiring an execution sequence of the configuration logic code, and calling a target function in the object array according to the execution sequence to execute the configuration logic code.
In one embodiment, before the obtaining the execution time of the configuration logic code, the method further includes:
acquiring function information associated with the configuration logic code;
acquiring starting time and starting frequency of the function information;
and generating the execution time of the configuration logic code according to the starting time and the starting frequency.
Referring to fig. 3, a computer device, which may be a mobile terminal and whose internal structure may be as shown in fig. 3, is also provided in the embodiment of the present application. The computer equipment comprises a processor, a memory, a network interface, a display device and an input device which are connected through a system bus. Wherein, the network interface of the computer equipment is used for communicating with an external terminal through network connection. The input means of the computer device is for receiving input from a user. The computer designed processor is used to provide computational and control capabilities. The memory of the computer device includes a storage medium. The storage medium stores an operating system, a computer program, and a database. The database of the computer device is used for storing data. The computer program is executed by a processor to implement a startup control method of configuring logic code.
The processor executes the start control method of the configuration logic code, and the method comprises the following steps: acquiring a configuration logic code of an IOS application program in a starting stage; writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure, and generating an array name corresponding to the configuration logic code; acquiring the execution time of the configuration logic code, and reading a target array in the target data segment according to the array name after the execution time is reached; and converting the target array into an object array, and calling a target function in the object array to execute the configuration logic code.
The computer equipment provides a method for executing configuration logic codes in an IOS application program in a self-defined mode, code logic in a program starting stage is written into a target DATA section of an executable file of the application program and then is taken out to be executed at the time needing to be executed, firstly, configuration logic codes in the IOS application program starting stage are obtained, the configuration logic codes are written into the target DATA section of the executable file of the IOS application program in a preset array structure, a number group name corresponding to the configuration logic codes is generated, the target DATA section is __ DATA section of the executable file, the corresponding configuration logic codes can be positioned through the number group name, the execution time of the configuration logic codes is obtained, after the execution time is reached, a target array in the target DATA section is read according to the number group name, and screening is carried out through the number group name, the corresponding configuration logic code can be positioned, the target array is converted into the object array, the target function in the object array is called to execute the configuration logic code, the execution time of the configuration logic code is self-determined, automatic execution in the initialization stage of the application program is avoided, the time of the program starting stage can be reduced, meanwhile, the configuration logic code segment needing to be executed is stored in an array mode and is executed after the execution time is resolved, the problem that the configuration logic code is covered is solved, and the starting efficiency and the success rate of the configuration logic code are improved.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by the processor, implements a startup control method for configuring logic code, including the steps of: acquiring a configuration logic code of an IOS application program in a starting stage; writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure, and generating an array name corresponding to the configuration logic code; acquiring the execution time of the configuration logic code, and reading a target array in the target data segment according to the array name after the execution time is reached; and converting the target array into an object array, and calling a target function in the object array to execute the configuration logic code.
The computer readable storage medium provides a method for executing configuration logic codes in an IOS application program in a customized manner, the code logic of a program starting stage is written into a target DATA segment of an executable file of the application program and then is taken out to be executed at the time needing to be executed, the configuration logic codes of the IOS application program starting stage are firstly obtained, the configuration logic codes are written into the target DATA segment of the executable file of the IOS application program in a preset array structure, a corresponding array name of the configuration logic codes is generated, the target DATA segment is __ DATA segment of the executable file, the corresponding configuration logic codes can be positioned through the array name, the execution time of the configuration logic codes is obtained, and after the execution time is reached, a target array in the target DATA segment is read according to the array name, the corresponding configuration logic code can be positioned by screening the array name, the target array is converted into the object array, the target function in the object array is called to execute the configuration logic code, the execution time of the configuration logic code is self-determined, automatic execution in an application program initialization stage is avoided, the time of a program starting stage can be reduced, meanwhile, the configuration logic code segment needing to be executed is stored in an array mode and executed after the execution time is resolved, the problem that the configuration logic code is covered is solved, and the starting efficiency and the success rate of the configuration logic code are improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above.
Any reference to memory, storage, database, or other medium provided herein and used in the embodiments may include non-volatile and/or volatile memory.
Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the scope of the present application.
All the equivalent structures or equivalent processes performed by using the contents of the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields, are included in the scope of protection of the present application.

Claims (10)

1. A method for controlling the start of a configuration logic code, comprising:
acquiring a configuration logic code of an IOS application program in a starting stage;
writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure, and generating an array name corresponding to the configuration logic code;
acquiring the execution time of the configuration logic code, and reading a target array in the target data segment according to the array name after the execution time is reached;
and converting the target array into an object array, and calling a target function in the object array to execute the configuration logic code.
2. The method for controlling startup of configuration logic code according to claim 1, wherein the obtaining configuration logic code of the IOS application startup phase comprises:
compiling the engineering code of the IOS application program through a preset compiler;
reading the compiled engineering code;
and determining a code segment containing preset keywords in the compiled engineering code as a configuration logic code of the IOS application program in a starting stage.
3. The method for controlling the start-up of configuration logic code according to claim 1, wherein the writing the configuration logic code into the target data segment of the executable file of the IOS application program in a preset array structure comprises:
acquiring the type of an array structure;
if the type is a Function type, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a Function form, and generating a pointer Function for executing the configuration logic code;
and if the type is a block type, writing the configuration logic code into a target data segment of an executable file of the IOS application program in a block form, and generating an anonymous function for executing the configuration logic code.
4. The method for controlling startup of configuration logic code according to claim 3, wherein said converting the target array into an object array and calling a target function in the object array to execute the configuration logic code comprises:
converting the target array into an object array, and calling a pointer function in the object array to execute the configuration logic code; or the like, or, alternatively,
and converting the target array into an object array, and calling an anonymous function in the object array to execute the configuration logic code.
5. The method for controlling startup of configuration logic code according to claim 1, wherein after writing the configuration logic code into a target data segment of an executable file of the IOS application program in a preset array structure and generating an array name corresponding to the configuration logic code, the method further comprises:
acquiring the priority of each configuration logic code;
adding an execution sequence field in the target data segment, and configuring the field value of the execution sequence field according to the priority so as to configure the execution sequence of the configuration logic code.
6. The method for controlling startup of configuration logic code according to claim 5, wherein said calling a target function in the object array to execute the configuration logic code comprises:
and acquiring an execution sequence of the configuration logic code, and calling a target function in the object array according to the execution sequence to execute the configuration logic code.
7. The method for controlling startup of configuration logic code according to claim 1, wherein said obtaining the execution time of the configuration logic code further comprises:
acquiring function information associated with the configuration logic code;
acquiring starting time and starting frequency of the function information;
and generating the execution time of the configuration logic code according to the starting time and the starting frequency.
8. An activation control apparatus that configures logic code, comprising:
the information acquisition module is used for acquiring the configuration logic code of the IOS application program in the starting stage;
the data storage module is used for writing the configuration logic codes into a target data segment of an executable file of the IOS application program in a preset array structure and generating an array name corresponding to the configuration logic codes;
the execution response module is used for acquiring the execution time of the configuration logic code and reading the target array in the target data segment according to the array name after the execution time is reached;
and the control execution module is used for converting the target array into an object array and calling a target function in the object array to execute the configuration logic code.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of a method of configuring the launch control of logic code according to any one of claims 1 to 7.
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 the method for configuring the start-up control of logic code according to any one of claims 1 to 7.
CN202210540185.XA 2022-05-17 2022-05-17 Starting control method, device, equipment and storage medium for configuring logic code Pending CN114860340A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210540185.XA CN114860340A (en) 2022-05-17 2022-05-17 Starting control method, device, equipment and storage medium for configuring logic code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210540185.XA CN114860340A (en) 2022-05-17 2022-05-17 Starting control method, device, equipment and storage medium for configuring logic code

Publications (1)

Publication Number Publication Date
CN114860340A true CN114860340A (en) 2022-08-05

Family

ID=82638773

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210540185.XA Pending CN114860340A (en) 2022-05-17 2022-05-17 Starting control method, device, equipment and storage medium for configuring logic code

Country Status (1)

Country Link
CN (1) CN114860340A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309740A (en) * 2013-06-05 2013-09-18 腾讯科技(深圳)有限公司 Program starting method, device and equipment
KR20130142311A (en) * 2012-06-19 2013-12-30 삼성전자주식회사 Method for reducing processing delay of application program and an electronic device thereof
CN108984223A (en) * 2018-05-31 2018-12-11 北京三快在线科技有限公司 A kind of routine call decoupling method, device, electronic equipment and storage medium
CN110737462A (en) * 2019-10-15 2020-01-31 腾讯科技(深圳)有限公司 Control method, device and storage medium for functional components in application program
CN112817657A (en) * 2021-01-29 2021-05-18 北京奇艺世纪科技有限公司 Application program starting item loading method, device and system and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130142311A (en) * 2012-06-19 2013-12-30 삼성전자주식회사 Method for reducing processing delay of application program and an electronic device thereof
CN103309740A (en) * 2013-06-05 2013-09-18 腾讯科技(深圳)有限公司 Program starting method, device and equipment
CN108984223A (en) * 2018-05-31 2018-12-11 北京三快在线科技有限公司 A kind of routine call decoupling method, device, electronic equipment and storage medium
CN110737462A (en) * 2019-10-15 2020-01-31 腾讯科技(深圳)有限公司 Control method, device and storage medium for functional components in application program
CN112817657A (en) * 2021-01-29 2021-05-18 北京奇艺世纪科技有限公司 Application program starting item loading method, device and system and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
互联网: "如何更全面管理win7启动项", pages 1 - 4, Retrieved from the Internet <URL:https://m.somode.com/Windows7/32548.html> *

Similar Documents

Publication Publication Date Title
CN111752830B (en) Automobile diagnosis system, and updating method, device and equipment of automobile diagnosis system
CN109597618B (en) Program development method, program development device, computer device, and storage medium
CN109726134B (en) Interface test method and system
CN112527415A (en) Method, device, equipment and medium for migrating applets across platforms
CN112380130A (en) Application testing method and device based on call dependency relationship
US20210224055A1 (en) Data interface processing method, device, server and medium
JPH1115689A (en) Method for debugging software and record medium recording debugging program
CN112487163B (en) Execution method of automatic flow and method and device for acquiring interface data of execution method
CN113590491A (en) Test platform and product test method
CN114860340A (en) Starting control method, device, equipment and storage medium for configuring logic code
CN112527286A (en) Service code generation method and device, computer equipment and storage medium
CN111966744A (en) Workflow deployment method and device, computer equipment and storage medium
CN113885897A (en) Packaging method, device and equipment of client installation package and storage medium
CN114860204A (en) Program processing method, program operating device, terminal, smart card and storage medium
CN107291439B (en) Target incremental data construction method and device
CN111143790B (en) Code obfuscation method, device, equipment and storage medium
CN113867776A (en) Method and device for publishing middle station application, electronic equipment and storage medium
CN112214213A (en) Linux kernel development and management method and device, computer equipment and storage medium
CN112463164A (en) SoC program execution display positioning method and device, computer equipment and storage medium
CN110597549A (en) Searching method, device and equipment in code engineering and readable storage medium
CN117251234B (en) Function calling method and device based on patches
CN115794260B (en) Simple dynamic loading method for DSP software library
CN113918461A (en) Interface test method, device, equipment and storage medium
CN113656103A (en) Configuration method and device for uploading files, computer equipment and storage medium
CN117632433A (en) Method, device equipment and storage medium for improving interrupt response speed

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