CN117591153A - Method and device for dynamically loading JS objects by IOS - Google Patents

Method and device for dynamically loading JS objects by IOS Download PDF

Info

Publication number
CN117591153A
CN117591153A CN202311557943.XA CN202311557943A CN117591153A CN 117591153 A CN117591153 A CN 117591153A CN 202311557943 A CN202311557943 A CN 202311557943A CN 117591153 A CN117591153 A CN 117591153A
Authority
CN
China
Prior art keywords
ios
resources
objects
dynamically loading
validity
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
CN202311557943.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.)
Shaoxing Daming Electric Power Construction Co ltd
Original Assignee
Shaoxing Daming Electric Power Construction Co 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 Shaoxing Daming Electric Power Construction Co ltd filed Critical Shaoxing Daming Electric Power Construction Co ltd
Priority to CN202311557943.XA priority Critical patent/CN117591153A/en
Publication of CN117591153A publication Critical patent/CN117591153A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method for dynamically loading JS objects by an IOS, which comprises the steps of creating an IOS project, receiving JS resources, storing the JS resources into a temporary directory, carrying out validity check on the JS resources, decomposing and reading the JS resources. The invention has the following advantages and effects: by dynamically loading JS, an application program can realize dynamic update of functions under the condition that a new version does not need to be released, so that the iteration and release speed of the functions can be increased, and a user is prevented from waiting for release of the new version; flexibly configuring and customizing personalized settings such as interfaces; acquiring the latest data or carrying out real-time communication with a server; different business requirements can be met, and better user experience is provided.

Description

Method and device for dynamically loading JS objects by IOS
Technical Field
The invention relates to the field of computer software, in particular to a method and a device for dynamically loading JS objects by an IOS.
Background
After the mobile App is released online, some bugs will always appear, resulting in a poor user experience. In the traditional method, a developer can only correct the bug in the next version of App, and the user can reinstall the bug coverage to solve the problems, but the method prolongs the bug repair period, the user is forced to experience the bug function for a long time, the endurance of the user is consumed, and a great amount of negative influence is brought to the user.
Disclosure of Invention
The invention aims to provide a method and a device for dynamically loading JS objects by an IOS.
The technical aim of the invention is realized by the following technical scheme: a method for dynamically loading JS objects by IOS, comprising the steps of:
s1: creating an IOS item;
s2: setting an IOS project to receive JS resources;
s3: storing the JS resources to a temporary directory;
s4: performing validity check on JS resources;
s5: decomposing and reading JS resources;
s6: and (5) ending.
Further provided is that: in S1, an IOS item is created using an XCODE tool.
Further provided is that: in S1, development is performed using object-c or swift language.
Further provided is that: in S2, when the received object is a non-JS resource, the received object is ignored.
Further provided is that: and S5, compiling the decomposed JS resources into a static library.
The invention also discloses a device for dynamically loading the JS objects by the IOS, which comprises a JS checking module, a validity checking module and a decomposing module which are arranged in the IOS project, wherein the JS checking module is used for judging JS files and ignoring non-JS files; the validity checking module is used for checking the validity of the JS resources and deleting illegal JS resources; the decomposition module is used for decomposing JS resources passing the validity verification.
In summary, the invention has the following beneficial effects: by dynamically loading JS, an application program can realize dynamic update of functions under the condition that a new version does not need to be released, so that the iteration and release speed of the functions can be increased, and a user is prevented from waiting for release of the new version; flexibly configuring and customizing personalized settings such as interfaces; acquiring the latest data or carrying out real-time communication with a server; different business requirements can be met, and better user experience is provided.
Drawings
FIG. 1 is a schematic diagram of a method for dynamically loading JS objects by an IOS;
FIG. 2 is a schematic diagram of an IOS device for dynamically loading JS objects
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
A method for dynamically loading JS objects by IOS, comprising the steps of:
the first step: to improve code readability, an ios project is newly created through XCODE (ios development tool) to encapsulate JS resources, and an object-c or swift language can be selected for development.
And a second step of: the IOS item has a JS checking module, configured to check whether the received resource is a JS resource, and if the received resource is determined to be a non-JS resource, ignore the received resource.
And a third step of: after determining that the received JS resource is the JS resource, the JS resource is stored in the temporary directory.
Fourth step: and (3) performing validity check on the JS resources, and searching whether illegal and illegal JS files exist or not, if so, directly deleting the temporary files. If not checked, it is very unsafe. The program APP will be destroyed destructively if serious.
Fifth step: after confirming that the JS resource is legal, decomposing and reading the JS resource. Related events are handled according to different contents. Such as modifying the style, behavior, and configuration of some interfaces, such as switching functions or directly generating data interactions to update content information.
Sixth step: and compiling the decomposed and read iOS program into a static library. The method comprises the following specific steps: the iOS item just created is opened and ensures that the correct target device and architecture has been selected. The ios item is selected in the Xcode and the Build Settings is entered. The search field is searched for "Mach-O Type" which is then set to Static Library. In Build Settings, the correct compile flags and configuration are ensured to be set. The project is compiled. A static library file (with a as the file extension) is generated. After the above steps are completed, a static library file of the iOS program is obtained, so that the static library can be used in other projects.
Seventh step: and (5) ending.
The device for dynamically loading the JS object by the IOS comprises a JS checking module, a validity checking module and a decomposing module which are arranged in the IOS project.
The JS checking module is used for judging JS files and ignoring non-JS files;
the validity checking module is used for checking the validity of the JS resources and deleting illegal JS resources;
the decomposition module is used for decomposing JS resources passing through validity verification, and the algorithm in the decomposition module can be a common algorithm or a self-written specific program algorithm.
The iOS dynamically loads JS with several common usage scenarios and advantages:
1. dynamically updating application functions: by dynamically loading JS, an application program can realize dynamic update of functions under the condition that a new version does not need to be released. Therefore, the function iteration and release speed can be increased, and the user is prevented from waiting for release of the new version. For example, some commonly used functional modules may be deployed remotely in the form of JS and these functions may be updated and switched by dynamically loading JS.
2. Flexible configuration and customization: dynamic loading of JS allows for flexible configuration and customization, and applications can dynamically modify the style, behavior, and configuration of some interfaces by maintaining JS configuration files on the server. Thus, personalized configurations can be provided for different users or groups of users according to different requirements.
Interaction with server data: the dynamic loading JS can conveniently perform data interaction and synchronization with the server. By loading the remote JS script, the latest data can be acquired or real-time communication can be carried out with the server. For example, in some applications that require real-time interaction with the backend, webSocket or long polling may be used for data transmission and communication with the server.
3. Quick iteration and repair: by dynamically loading JS, some problems or vulnerabilities in the application can be repaired more quickly and flexibly. When a problem occurs, the development team can quickly repair JS codes or logic, and deploy the updated JS to a server, and then enable all users to obtain repaired functions through dynamic loading of JS.
Overall, dynamically loading JS provides the advantages of flexibility, configurability, and fast iteration in iOS development, can meet different business needs, and provides better user experience.
The present embodiment is only for explanation of the present invention and is not to be construed as limiting the present invention, and modifications to the present embodiment, which may not creatively contribute to the present invention as required by those skilled in the art after reading the present specification, are all protected by patent laws within the scope of claims of the present invention.

Claims (6)

1. A method for dynamically loading JS objects by IOS, which is characterized in that: the method comprises the following steps:
s1: creating an IOS item;
s2: setting an IOS project to receive JS resources;
s3: storing the JS resources to a temporary directory;
s4: performing validity check on JS resources;
s5: decomposing and reading JS resources;
s6: and (5) ending.
2. The method for dynamically loading JS objects by IOS of claim 1, wherein: in S1, an IOS item is created using an XCODE tool.
3. The method for dynamically loading JS objects by IOS of claim 1, wherein: in S1, development is performed using object-c or swift language.
4. The method for dynamically loading JS objects by IOS of claim 1, wherein: in S2, when the received object is a non-JS resource, the received object is ignored.
5. The method for dynamically loading JS objects by IOS of claim 1, wherein: and S5, compiling the decomposed JS resources into a static library.
6. An apparatus for dynamically loading JS objects by IOS, characterized in that: the system comprises a JS checking module, a validity checking module and a decomposing module which are arranged in the IOS project, wherein the JS checking module is used for judging JS files and ignoring non-JS files; the validity checking module is used for checking the validity of the JS resources and deleting illegal JS resources; the decomposition module is used for decomposing JS resources passing the validity verification.
CN202311557943.XA 2023-11-20 2023-11-20 Method and device for dynamically loading JS objects by IOS Pending CN117591153A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311557943.XA CN117591153A (en) 2023-11-20 2023-11-20 Method and device for dynamically loading JS objects by IOS

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311557943.XA CN117591153A (en) 2023-11-20 2023-11-20 Method and device for dynamically loading JS objects by IOS

Publications (1)

Publication Number Publication Date
CN117591153A true CN117591153A (en) 2024-02-23

Family

ID=89912725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311557943.XA Pending CN117591153A (en) 2023-11-20 2023-11-20 Method and device for dynamically loading JS objects by IOS

Country Status (1)

Country Link
CN (1) CN117591153A (en)

Similar Documents

Publication Publication Date Title
CN108027722B (en) Dynamically updating applications in compilation and deployment
US10331425B2 (en) Automated source code adaption to inject features between platform versions
US11429365B2 (en) Systems and methods for automated retrofitting of customized code objects
US20240045850A1 (en) Systems and methods for database orientation transformation
CN108319460B (en) Method and device for generating application program installation package, electronic equipment and storage medium
CN106775744B (en) Method and device for generating static library
CN109597621B (en) Method and device for packaging Dagger, terminal equipment and storage medium
CN107577609B (en) Embedded system dynamic module debugging system based on host end dynamic link
CN111068328A (en) Game advertisement configuration table generation method, terminal device and medium
CN111857801B (en) Construction method of mobile application
WO2017087801A1 (en) Dynamic update of an application in compilation and deployment
US20190042233A1 (en) Application architecture generation
CN112286504A (en) Method for realizing development and loading of small program based on Reactnative in mobile APP
CN110580146B (en) Mixed application solving system based on eros
CN107092472B (en) Dynamic publishing method and device
CN117215558A (en) Visual software development method, device, equipment and medium for android
CN117112060A (en) Component library construction method and device, electronic equipment and storage medium
CN110334031A (en) Memory Allocation code detection method, device, computer equipment and storage medium
CN117591153A (en) Method and device for dynamically loading JS objects by IOS
CN112748905B (en) Method and device for initializing and calling basic library, electronic equipment and storage medium
CN111367512B (en) Method and device for creating Android library module dependency relationship in application development
CN116991355B (en) Method, system and device for supporting LED driving chip by modifying and iterating script
KR101506656B1 (en) System for quality management of application and method therefor
CN116679912A (en) Code generation method, apparatus, device, storage medium, and computer program
CN114489687A (en) Method and related device for deploying service instance

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