CN113220374A - Software processing method and device - Google Patents

Software processing method and device Download PDF

Info

Publication number
CN113220374A
CN113220374A CN202010070738.0A CN202010070738A CN113220374A CN 113220374 A CN113220374 A CN 113220374A CN 202010070738 A CN202010070738 A CN 202010070738A CN 113220374 A CN113220374 A CN 113220374A
Authority
CN
China
Prior art keywords
file
target
applet
browser
source
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
CN202010070738.0A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010070738.0A priority Critical patent/CN113220374A/en
Publication of CN113220374A publication Critical patent/CN113220374A/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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/51Source to source

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a software processing method and device. The software processing method comprises the following steps: acquiring a software package of an applet, wherein the applet is an application running by relying on an instant messaging application of a mobile terminal; decompressing the software package, and generating a resource file based on a source file format of a browser in the webpage end; and configuring a target communication file, a target interface file and a target system layer file based on the source file format of the browser in the webpage end to run the small program. According to the technical scheme of the embodiment of the application, the software package of the applet is directly obtained and configured at the webpage end aiming at each applet, the applet can run in the webpage end without redeveloping and compiling a set of software package suitable for the browser in the webpage end, the development period is greatly shortened, and the development efficiency is improved to a certain extent.

Description

Software processing method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a software processing method and apparatus.
Background
The small program depends on the application of the instant messaging application in the mobile terminal, and the user can open the small program for use by scanning or searching once, so that the method is convenient and quick. At present, when each applet needs to be enabled to run on a web browser on a desktop computer or a portable computer, a developer needs to develop a set of applet software package completely suitable for a web when developing services, and the corresponding development period is long and the development efficiency is low.
Disclosure of Invention
The embodiment of the application provides a software processing method and device, which avoids the problem that a software package suitable for a webpage end browser needs to be redeveloped and compiled for each applet, and the applet can be suitable for the webpage end browser only by configuring the webpage end browser.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of the embodiments of the present application, there is provided a software processing method applied to a web page side, including: acquiring a software package of an applet, wherein the applet is an application running by relying on an instant messaging application of a mobile terminal; decompressing the software package, and generating a resource file based on a source file format of a browser in the webpage end; and configuring a target communication file, a target interface file and a target system layer file based on the source file format of the browser in the webpage end to run the small program.
According to an aspect of an embodiment of the present invention, there is provided a software processing apparatus including: the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a software package of an applet, and the applet is an application which runs by depending on an instant messaging application of a mobile terminal; the first generation unit is used for decompressing the software package and generating a resource file based on a source file format of a browser in the webpage end; and the configuration unit is used for configuring a target communication file, a target interface file and a target system layer file based on the source file format of the browser in the webpage end so as to run the applet.
In some embodiments of the present application, based on the foregoing scheme, the first generating unit is configured to: the generating subunit is used for decompressing the software package and generating a first source file in a source file format supported by a browser in a webpage end; and the adding subunit is used for adding a source code for converting a screen size unit into the first source file to generate the resource file.
In some embodiments of the present application, based on the foregoing scheme, the generating subunit is configured to: acquiring a source code for realizing the conversion of the screen size; determining a target source file for screen display processing in the first source file according to the file name; and inserting a source code for realizing the conversion of the screen size into the target source file to generate the resource file.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: the second acquisition unit is used for acquiring the operating system type of the webpage end; the first execution unit is used for determining the target communication file, the target interface file and the target system layer file which need to be configured according to the acquired corresponding relation among the operating system type, the communication file, the interface file and the system layer file which need to be configured; and the third acquisition unit is used for acquiring the target communication file, the target interface file and the target system layer file.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: a fourth obtaining unit, configured to obtain a call request event initiated by an applet and directed to a target API, where the call request event includes identification information of the target API; and the second generating unit is used for generating warning information if the target API is determined to be an API which is not supported by the browser according to the identification information of the target API.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: and the second execution unit is used for generating a simulation response event aiming at the call request event and executing the simulation response event if the target API is determined to be the API supported by the browser according to the identification information of the target API.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: a fifth obtaining unit, configured to obtain an uninstall request input by a browser in the web page, where the uninstall request includes identification information of a target applet that requests uninstall; and the deleting unit is used for determining the resource file of the target small program based on the identification information of the target small program and deleting the resource file of the target small program.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: and the first storage unit is used for storing the resource file in the memory.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: and the second storage unit is used for storing the target communication file, the target interface file and the target system layer file in a disk file.
According to an aspect of the embodiments of the present application, there is provided a computer readable medium on which a computer program is stored, the computer program, when executed by a processor, implementing the software processing method as described in the above embodiments.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the software processing method as described in the above embodiments.
In the technical solutions provided in some embodiments of the present application, by obtaining a software package of an applet and decompressing the software package, a resource file is generated based on a source file format of a browser in a web page side, and a target communication file, a target interface file, and a target system layer file are configured based on the source file format of the browser in the web page side to run the applet, so that the applet can directly obtain the software package of the applet and configure the applet at the web page side without redeveloping and compiling a set of software package suitable for the browser in the web page side, and can run in the web page side, thereby greatly shortening a development period and improving development efficiency to a certain extent.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
In the drawings:
FIG. 1 shows a schematic diagram of an exemplary system architecture to which aspects of embodiments of the present application may be applied;
FIG. 2 shows a flow diagram of a software processing method according to one embodiment of the present application.
Fig. 3 shows a detailed flowchart of step S220 of the software processing method according to an embodiment of the present application.
Fig. 4 shows a detailed flowchart of step S320 of the software processing method according to an embodiment of the present application.
FIG. 5 is a diagram illustrating a system architecture of a web site according to an embodiment of the present application.
FIG. 6 shows a flow diagram of a software processing method according to one embodiment of the present application.
FIG. 7 shows a flow diagram of a software processing method according to one embodiment of the present application.
FIG. 8 shows a flow diagram of a software processing method according to one embodiment of the present application.
Fig. 9A shows an interface diagram of a stock applet running on a mobile side in one embodiment of the application.
FIG. 9B illustrates an interface diagram of a stock applet running on a web site in one embodiment of the application.
FIG. 10 shows a block diagram of a software processing apparatus according to an embodiment of the present application.
FIG. 11 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied.
As shown in fig. 1, the system architecture may include a web page side (such as the portable computer 101 shown in fig. 1, but may also be a desktop computer, etc.), a network 102, and a server 103. Network 102 is the medium used to provide communication links between web sites and server 103. Network 102 may include various connection types, such as wired communication links, wireless communication links, and so forth.
It should be understood that the number of web sites, networks, and servers in FIG. 1 is merely illustrative. There may be any number of web sites, networks, and servers, as desired for implementation. For example, the server 103 may be a server cluster composed of a plurality of servers. The user can use the webpage side to interact with the server through the network so as to receive or send messages and the like. The server may be a server that provides various data processing services.
The technical scheme of the embodiment of the application can be applied to a webpage end. In the technical scheme of the application embodiment, the webpage end obtains a software package of the applet, wherein the applet is an application running depending on an instant messaging application of the mobile end, the webpage end decompresses the software package, and a resource file is generated based on a source file format of a browser in the webpage end, and the resource file comprises a view layer file and a logic layer file in the applet. In the running process of the applet, when the source code in the view layer file is executed, the applet is used for realizing a page rendering structure, and when the source code in the logic layer file is executed, the applet is used for realizing functions of logic processing, data request, interface calling and the like; in addition, the target communication file, the target interface file and the target system layer file are configured based on a source file format of the browser in the webpage end to run the applet, wherein when the source codes in the target communication file and the target interface file are executed, the applet can communicate with the browser in the webpage end and call the API; when the source code in the target system layer file is executed, the source code is used for enabling the small program to call partial bottom layer functions provided by a browser in the webpage end; and then aiming at each applet, directly acquiring the software package of the applet and configuring the software package at the webpage end, and the applet can run in the webpage end without redevelopment and compilation of a set of software package suitable for a browser in the webpage end, so that the development period is greatly shortened, and the development efficiency is improved to a certain extent.
It should be noted that the software processing method provided in the embodiments of the present application is generally executed by a web page, and accordingly, the software processing apparatus is generally disposed in the web page. However, in other embodiments of the present application, the server may also have a similar function as the web page, so as to execute the solution of the software processing apparatus provided in the embodiments of the present application.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
fig. 2 shows a flowchart of a software processing method according to an embodiment of the present application, which may be executed by a web site, which may be the portable computer 101 shown in fig. 1, or may be a desktop computer, etc., as shown in fig. 1. Referring to fig. 2, the software processing method at least includes steps S210 to S230, which are described in detail as follows.
In step S210, a software package of an applet is obtained, where the applet is an application running on the basis of an instant messaging application of the mobile terminal.
In an embodiment of the application, the applet is an application that runs by relying on an instant messaging application at a mobile terminal, a software package of the applet is a source file stored in an installation package of the instant messaging application, the software package of the applet can be a source file with a file extension of ". wxapkg", the source file includes a view layer file and a logic layer file, and the applet implements a rendering page structure by executing the view layer file and implements functions such as logic processing, data request, interface call and the like by executing the logic layer file. In the mobile terminal, the view layer file and the logic layer file of the applet may be configured in a file format of app-config.json, in the file format of this type, the IS code in the view layer file and the logic layer file may be stored in a file name of app-service.js, and the HTML frame file code in the view layer file and the logic layer file may be stored in a file name of page-frame.html.
In an embodiment of the present application, when acquiring a software package of an applet, the applet may be acquired from an external mobile terminal device or downloaded from a corresponding resource server, or may be acquired from a local storage space of a web page side, which is not limited herein.
In step S220, the software package is decompressed, and a resource file is generated based on the source file format of the browser in the web page.
In an embodiment of the application, after the software package corresponding to the applet is obtained, the software package may be decompressed to obtain decompressed file data, and for the file data, the file data may be processed based on a source file format of a browser in a web page end to generate a required resource file. The source file format of the browser in the web page end is a source file format supported by the browser in the web page end, and the format is related to the type of the operating system currently carried by the device where the web page end is located, for example, when the type of the operating system currently carried by the device where the web page end is located is a Linux system, the source file format of the browser in the web page end may be a source file format in an HTML/CSS/JS format.
The resource file is a source file containing all source codes in the view layer file and the logic layer file, and when the source codes in the resource file are executed in a browser at a webpage end, the source codes are used for enabling the applet to achieve a page rendering structure and achieve functions of logic processing, data request, interface calling and the like.
Referring to fig. 3, fig. 3 shows a detailed flowchart of step S220 of the software processing method according to an embodiment of the present application, and step S220 may specifically include step S310 to step S320, which are described in detail as follows.
In step S310, the software package is decompressed, and a first source file in a source file format supported by the browser in the web page is generated.
In an embodiment of the present application, when generating a resource file according to a software package of an applet, the software package of the applet may be decompressed first, and a first source file in a source file format supported by a browser in a web page end is generated, so as to further generate a required resource file.
In step S320, adding source code for converting screen size units to the first source file, and generating the resource file.
When the applet runs in the mobile terminal, the displayed screen size unit is in the RPX format, and on the web page side, the supported screen size unit is in the PX format. Because the screen size unit displayed when the applet runs at the mobile terminal is different from the screen size unit displayed when the browser runs at the web page terminal, in order to enable the applet to normally display at the browser at the web page terminal, a source code for converting the screen size unit needs to be added to the first source file, and then the required resource file is generated.
The source code for converting the screen size unit is a precompiled source code, and after the source code for converting the screen size unit is added, the source code is executed to convert the screen size suitable for the mobile terminal into the screen size suitable for the browser in the webpage terminal.
By adding the source code for converting the screen size unit into the resource file, the condition that the page needing to be displayed by the small program cannot be displayed due to different screen size units is avoided, and the page needing to be displayed by the small program can be normally displayed by a browser in a webpage end.
Referring to fig. 4, fig. 4 shows a detailed flowchart of step S320 of the software processing method according to an embodiment of the present application, and step S320 may specifically include step S410 to step S430, which are described in detail as follows.
In step S410, source code that realizes the conversion of the screen size is acquired.
In an embodiment of the present application, when generating a required resource file, a source code for converting a screen size may be obtained, and the source code for converting a screen size unit may be downloaded from a corresponding resource server, or may be obtained from a local storage space of a web page side, which is not limited herein.
In step S420, a target source file for performing screen presentation processing is determined in the first source file according to a file name.
When the resource file is generated according to the first source file, a target source file for performing screen display processing needs to be determined in the first source file, and when source code in the target source file is executed, the target source file is used for processing page data so as to be processed into page data suitable for performing page display on an application display interface. Specifically, when a target source file for performing screen display processing is determined in the first source files, all the first source files can be searched according to the file names of the target source files, and the required target source file is determined.
In step S430, a source code for converting the screen size is inserted into the target source file, and the resource file is generated.
After the target source file is determined, inserting the acquired source code for realizing the conversion of the screen size into the target source file, and further generating the required resource file.
Still referring to fig. 2, in step S230, a target communication file, a target interface file and a target system layer file are configured based on a source file format of a browser in the web page side to run the applet.
In the mobile terminal, the applet may implement communication with the mobile terminal and make API calls through the communication file and the interface file, for example, the communication file and the interface file may be configured as WeixinJSBridge to implement communication with the mobile terminal and make API calls.
In order to enable the applet to run in the web page side, it is necessary to enable the applet to communicate with the browser in the web page side, call an API, or call a part of the underlying functions in the browser in the web page side when the applet runs in the browser in the web page side. It is thus necessary to configure the target communication file, the target interface file, and the target system layer file based on the source file format of the browser in the web page side. When executed, the source code in the target communication file and the target interface file is used for enabling the applet to communicate with the browser in the webpage end and make API calls, for example, the communication file and the interface file can be configured as JSBridge to implement communication with the mobile end and make API calls.
The source code in the target system level file, when executed, is used to enable the applet to invoke a portion of the underlying functionality provided by the browser in the web site.
It should be noted that there is no sequential execution order between step S230 and step S220, that is, step S230 and step S220 may be executed in two threads respectively, or step S230 may be executed first and then step S220 is executed, which is not limited herein.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a system architecture of a web page side according to an embodiment of the present application, where the system architecture of the web page side includes an applet, a JsBridge, and a browser system layer; the small program comprises a view layer and a logic layer, wherein the view layer is used for enabling the small program to achieve a page rendering structure, and the logic layer is used for enabling the small program to achieve functions of logic processing, data request, interface calling and the like; the JsBridge is used for enabling the applet to communicate with a browser in a webpage end and call an API, and the JsBridge can also enable a view layer and a logic layer in the applet to communicate with each other, for example, when a user operates a virtual control in a display interface of the applet, the user can trigger generation of a corresponding execution event, the view layer informs the logic layer of the triggered event through the JsBridge to perform business processing, and the logic layer informs the view layer of the change of page data subjected to the business processing through the JsBridge to further trigger the update of a page of the view layer. The browser system layer is used for enabling the small program to call partial bottom functions provided by the browser in the webpage end, such as executing calling events initiated by the small program and aiming at a certain API.
As can be seen from the above, by obtaining the software package of the applet and decompressing the software package, the resource file is generated based on the source file format of the browser in the web page side, and the resource file includes the view layer file and the logic layer file in the applet. In the running process of the applet, when the source code in the view layer file is executed, the applet is used for realizing a page rendering structure, and when the source code in the logic layer file is executed, the applet is used for realizing logic processing, data request, interface calling and the like; in addition, the target communication file, the target interface file and the target system layer file are configured based on a source file format of the browser in the webpage end to run the applet, wherein when the source codes in the target communication file and the target interface file are executed, the applet can communicate with the browser in the webpage end and call the API; the source code in the target system level file, when executed, is used to enable the applet to invoke a portion of the underlying functionality provided by the browser in the web site. Therefore, the software package of the small program is directly obtained and configured at the webpage end aiming at each small program, the small program can run in the webpage end without redevelopment and compilation of a set of software package suitable for a browser in the webpage end, the development period is greatly shortened, and the development efficiency is improved to a certain extent.
Referring to fig. 6, fig. 6 shows a flowchart of a software processing method according to an embodiment of the present application, which may further include steps S610 to S630, described in detail below.
In step S610, the operating system type of the web page is obtained.
In an embodiment of the present application, the operating system type of the web page is an operating system type currently carried by a device where the web page is located, and the operating system type may specifically be a different operating system type such as a windows system, a Linux system, and the like. Specifically, the operating system type of the web page end may be obtained from system configuration information corresponding to the device where the web page end is located.
In step S620, the target communication file, the target interface file, and the target system layer file that need to be configured are determined according to the correspondence between the obtained operating system type and the communication file, interface file, and system layer file that need to be configured.
In an embodiment of the present application, the correspondence between the operating system type and the communication file, the interface file, and the system layer file that need to be configured may specifically be a mapping table that includes mapping relationships between different operating system types and the communication file, the interface file, and the system layer file that need to be configured. The communication file, the interface file and the system layer file are all source files which are compiled in advance aiming at different operating system types, so that the files can be configured in the webpage ends of the different operating system types.
When the type of the operating system currently carried by the device where the webpage end is located is obtained, a target communication file, a target interface file and a target system layer file which need to be configured can be determined according to the obtained operating system type and the mapping relation table.
In step S630, the target communication file, the target interface file, and the target system layer file are acquired.
After determining the target communication file, the target interface file and the target system layer file which need to be configured, the target communication file, the target interface file and the target system layer file which need to be configured may be downloaded from a corresponding resource server or acquired from a local storage space of a web page terminal, so as to facilitate configuration.
Referring to fig. 7, fig. 7 shows a flowchart of a software processing method according to an embodiment of the present application, which may further include steps S710 to S720, described in detail below.
In step S710, a call request event initiated by the applet and directed to the target API is obtained, where the call request event includes identification information of the target API.
The call request event for the target API is a request call initiated by an applet for a certain function existing locally at the mobile terminal, such as functions of network downloading, position acquisition, payment, compass, accelerometer, and the like. Because part of the APIs required to be called by the applet are specific to the mobile terminal, such as the APIs of a compass, an accelerometer and the like, the part of the APIs cannot be realized at the webpage terminal, and the normal use of the applet at the webpage terminal is avoided being influenced. When a call request event initiated by an applet and aiming at a certain target API is obtained, it needs to determine whether the target API requested in the call request event is an API supported by the browser. The identification information of the target API is unique identification information of the target API, and is used for identifying the API by the webpage end, and the identification information may specifically be calling interface information of the API.
In step S720, if it is determined that the target API is an API that is not supported by the browser according to the identification information of the target API, generating warning information.
The webpage end can locally pre-store identification information tables of all APIs supported by the browser, if the target API is determined to be the API not supported by the browser according to the identification information of the target API and the identification information tables, warning information is generated, the warning information can be character string information of the function which cannot be used currently, the webpage end can display the warning information on a display page to prompt that the function corresponding to the target API cannot be executed currently, the situation that a user repeats unnecessary operation can be avoided, and user experience is improved.
In an embodiment of the present application, after the step S710 of obtaining a call request event initiated by an applet and directed to a target API, the software processing method of an embodiment of the present application further includes: and if the target API is determined to be the API supported by the browser according to the identification information of the target API, generating a simulated response event aiming at the call request event, and executing the simulated response event.
When a call request event initiated by the applet and aiming at a certain target API is acquired, if the target API is determined to be the API supported by the browser according to the identification information of the target API and the identification information table, a simulation response event aiming at the call request event can be generated, and the simulation response event is executed. When the simulation response event is executed at the webpage end, the simulation response event can execute the same or similar response action simulated by the response action executed by the mobile end aiming at the call request event, so that the applet realizes the response to the call request event of the target API at the webpage end.
Referring to fig. 8, fig. 8 shows a flowchart of a software processing method according to an embodiment of the present application, which may further include steps S810 to S820, described in detail below.
In step S810, an uninstall request input by the browser in the web page is obtained, where the uninstall request includes identification information of a target applet that requests uninstall.
The uninstall request is a request initiated by a certain applet installed in a browser in the web page end to uninstall the applet, and the request can be triggered by a virtual function button provided by the browser in the web page end by a user. The identification information of the applet is a unique identification for identifying different applets, and specifically may be a unique application identification of each applet or a unique application name identification customized for each applet, which is not limited herein.
In step S820, the resource file of the target applet is determined based on the identification information of the target applet, and the resource file of the target applet is deleted.
After the identification information of the target small program needing to be unloaded in the unloading request is obtained, the resource file of the target small program is found from the resource files storing all small programs according to the identification information of the target small program needing to be unloaded, and the action of deleting the resource file of the target small program is executed, so that the small program installed in the webpage end browser can be unloaded in a self-defined manner, and the personalized requirement of a user is met.
In an embodiment of the application, after the step S220 of decompressing the software package and generating a resource file based on a source file format of a browser in the web page end, the software processing method further includes: and storing the resource file in a memory.
After the resource file is generated, the resource file at the webpage end is small, so that the resource file can be stored in the memory without being written into the local disk file at the webpage end, the efficiency of reading and writing the source file in the resource file can be improved, the smoothness of the small program during running can be improved, and the number of the local disk input interface and the local disk output interface at the webpage end can be reduced.
In an embodiment of the application, after the step S230 of decompressing the software package and configuring a target communication file, a target interface file, and a target system layer file based on a source file format of a browser in the web page side to run the applet, the software processing method further includes: and storing the target communication file, the target interface file and the target system layer file in a disk file.
When the target communication file, the target interface file and the target system layer file are configured based on the source file format of the browser in the webpage end, the target communication file, the target interface file and the target system layer file can be stored in the disk file and are not stored in the memory, so that the influence on the smoothness of the small program in operation can be avoided, and the smoothness of the small program in operation can be improved to a certain extent.
The technical scheme in this embodiment is described below by taking an example in which a stock applet is applied to a web page, the web page obtains a software package of the stock applet, where the stock applet is a stock application running on the basis of an instant messaging application of a mobile terminal, the web page decompresses the software package of the stock applet, and generates a resource file of the stock applet based on a source file format of a browser in the web page, and the resource file of the stock applet includes a view layer file and a logic layer file in the applet. In the running process of the stock applet, when the source code in the view layer file is executed, the stock applet is used for realizing a rendering page structure, and when the source code in the logic layer file is executed, the stock applet is used for realizing functions of logic processing, data request, interface calling and the like; in addition, the target communication file, the target interface file and the target system layer file are configured based on the source file format of the browser in the webpage end to run the stock applet, wherein when the source codes in the target communication file and the target interface file are executed, the stock applet can communicate with the browser in the webpage end and call the API; the source code in the target system level file is executed to enable the stock applet to invoke portions of the underlying functionality provided by the browser in the web site.
Fig. 9A shows an interface diagram of a stock applet running on a mobile terminal in one embodiment of the present application, and fig. 9B shows an interface diagram of a stock applet running on a web page terminal in one embodiment of the present application. Referring to fig. 9A and 9B, based on the above processing, the software package of the stock applet can be directly obtained for the stock applet running on the mobile terminal and configured on the web page terminal, and the stock applet can run on the web page terminal without redeveloping and compiling a set of software packages suitable for a browser in the web page terminal, so that the development cycle of the stock applet is greatly shortened, and the development efficiency is improved to a certain extent.
The following describes embodiments of an apparatus of the present application, which may be used to perform the software processing method in the above-described embodiments of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, refer to the embodiments of the software processing method described above in the present application.
FIG. 10 shows a block diagram of a software processing apparatus according to an embodiment of the present application. Referring to fig. 10, a software processing apparatus 1000 according to an embodiment of the present application includes: according to an aspect of an embodiment of the present invention, there is provided a software processing apparatus including: a first obtaining unit 1010, configured to obtain a software package of an applet, where the applet is an application running on an instant messaging application of a mobile terminal; a first generating unit 1020, configured to decompress the software package, and generate a resource file based on a source file format of a browser in the web page; a configuring unit 1030, configured to configure a target communication file, a target interface file, and a target system layer file based on a source file format of a browser in the web page end to run the applet.
In some embodiments of the present application, based on the foregoing scheme, the first generating unit 1020 is configured to: the generating subunit is used for decompressing the software package and generating a first source file in a source file format supported by a browser in a webpage end; and the adding subunit is used for adding a source code for converting a screen size unit into the first source file to generate the resource file.
In some embodiments of the present application, based on the foregoing scheme, the generating subunit is configured to: acquiring a source code for realizing the conversion of the screen size; determining a target source file for screen display processing in the first source file according to the file name; and inserting a source code for realizing the conversion of the screen size into the target source file to generate the resource file.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: the second acquisition unit is used for acquiring the operating system type of the webpage end; the first execution unit is used for determining the target communication file, the target interface file and the target system layer file which need to be configured according to the acquired corresponding relation among the operating system type, the communication file, the interface file and the system layer file which need to be configured; and the third acquisition unit is used for acquiring the target communication file, the target interface file and the target system layer file.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: a fourth obtaining unit, configured to obtain a call request event initiated by an applet and directed to a target API, where the call request event includes identification information of the target API; and the second generating unit is used for generating warning information if the target API is determined to be an API which is not supported by the browser according to the identification information of the target API.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: and the second execution unit is used for generating a simulation response event aiming at the call request event and executing the simulation response event if the target API is determined to be the API supported by the browser according to the identification information of the target API.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: a fifth obtaining unit, configured to obtain an uninstall request input by a browser in the web page, where the uninstall request includes identification information of a target applet that requests uninstall; and the deleting unit is used for determining the resource file of the target small program based on the identification information of the target small program and deleting the resource file of the target small program.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: and the first storage unit is used for storing the resource file in the memory.
In some embodiments of the present application, based on the foregoing solution, the software processing apparatus further includes: and the second storage unit is used for storing the target communication file, the target interface file and the target system layer file in a disk file.
FIG. 11 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
It should be noted that the computer system 1100 of the electronic device shown in fig. 11 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 11, a computer system 1100 includes a Central Processing Unit (CPU)1101, which can perform various appropriate actions and processes, such as performing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 1102 or a program loaded from a storage section 1108 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data necessary for system operation are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An Input/Output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input portion 1106 including a keyboard, mouse, and the like; an output section 1107 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 1108 including a hard disk and the like; and a communication section 1109 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. A driver 1110 is also connected to the I/O interface 1105 as necessary. A removable medium 1111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1110 as necessary, so that a computer program read out therefrom is mounted into the storage section 1108 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 1109 and/or installed from the removable medium 1111. When the computer program is executed by a Central Processing Unit (CPU)1101, various functions defined in the system of the present application are executed.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A software processing method is applied to a webpage end and is characterized by comprising the following steps:
acquiring a software package of an applet, wherein the applet is an application running by relying on an instant messaging application of a mobile terminal;
decompressing the software package, and generating a resource file based on a source file format of a browser in the webpage end;
and configuring a target communication file, a target interface file and a target system layer file based on the source file format of the browser in the webpage end to run the small program.
2. The software processing method according to claim 1, wherein said decompressing said software package, and generating a resource file based on a source file format of a browser in a web page side, comprises:
decompressing the software package to generate a first source file in a source file format supported by a browser in a webpage end;
and adding a source code for converting a screen size unit into the first source file to generate the resource file.
3. The software processing method according to claim 2, wherein the adding source code for converting a screen size unit to the first source file to generate the resource file comprises:
acquiring a source code for realizing the conversion of the screen size;
determining a target source file for screen display processing in the first source file according to the file name;
and inserting a source code for realizing the conversion of the screen size into the target source file to generate the resource file.
4. The software processing method according to claim 1, characterized by further comprising:
acquiring the type of an operating system of the webpage end;
determining the target communication file, the target interface file and the target system layer file which need to be configured according to the acquired corresponding relation among the type of the operating system, the communication file, the interface file and the system layer file which need to be configured;
and acquiring the target communication file, the target interface file and the target system layer file.
5. The software processing method according to claim 1, characterized by further comprising:
acquiring a call request event aiming at a target API, which is initiated by an applet, wherein the call request event comprises identification information of the target API;
and if the target API is determined to be the API which is not supported by the browser according to the identification information of the target API, generating warning information.
6. The software processing method according to claim 5, wherein after acquiring an applet-initiated call request event for a target API, the software processing method further comprises:
and if the target API is determined to be the API supported by the browser according to the identification information of the target API, generating a simulated response event aiming at the call request event, and executing the simulated response event.
7. The software processing method according to claim 1, characterized by further comprising:
acquiring an uninstalling request input by a browser in the webpage end, wherein the uninstalling request comprises identification information of a target applet requiring uninstalling;
and determining the resource file of the target small program based on the identification information of the target small program, and deleting the resource file of the target small program.
8. The software processing method according to claim 1, wherein after decompressing the software package and generating a resource file based on a source file format of a browser in the web page side, the software processing method further comprises:
and storing the resource file in a memory.
9. The software processing method according to claim 1, wherein after configuring a target communication file, a target interface file, and a target system layer file based on a source file format of a browser in the web page side to run the applet, the software processing method further comprises:
and storing the target communication file, the target interface file and the target system layer file in a disk file.
10. A software processing apparatus, comprising:
the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a software package of an applet, and the applet is an application which runs by depending on an instant messaging application of a mobile terminal;
the first generation unit is used for decompressing the software package and generating a resource file based on a source file format of a browser in the webpage end;
and the configuration unit is used for configuring a target communication file, a target interface file and a target system layer file based on the source file format of the browser in the webpage end so as to run the applet.
CN202010070738.0A 2020-01-21 2020-01-21 Software processing method and device Pending CN113220374A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010070738.0A CN113220374A (en) 2020-01-21 2020-01-21 Software processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010070738.0A CN113220374A (en) 2020-01-21 2020-01-21 Software processing method and device

Publications (1)

Publication Number Publication Date
CN113220374A true CN113220374A (en) 2021-08-06

Family

ID=77085430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010070738.0A Pending CN113220374A (en) 2020-01-21 2020-01-21 Software processing method and device

Country Status (1)

Country Link
CN (1) CN113220374A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760762A (en) * 2021-09-08 2021-12-07 北京房江湖科技有限公司 Method for simulating operating environment of applet, electronic device and storage medium
CN114077368A (en) * 2022-01-19 2022-02-22 腾讯科技(深圳)有限公司 Vehicle-mounted applet running method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980504A (en) * 2017-03-28 2017-07-25 腾讯科技(深圳)有限公司 A kind of application development method and its instrument, equipment
CN107239318A (en) * 2017-06-13 2017-10-10 腾讯科技(深圳)有限公司 Using conversion method, device and equipment
CN108268262A (en) * 2017-12-27 2018-07-10 广东耐思尼克信息技术有限公司 Realize the method, apparatus and system that HTML is converted to wechat small routine
CN109710260A (en) * 2018-11-16 2019-05-03 青岛特锐德电气股份有限公司 It is a kind of based on multi-platform applet code converting system and conversion method
CN110704136A (en) * 2019-09-27 2020-01-17 北京百度网讯科技有限公司 Rendering method of small program assembly, client, electronic device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980504A (en) * 2017-03-28 2017-07-25 腾讯科技(深圳)有限公司 A kind of application development method and its instrument, equipment
CN107239318A (en) * 2017-06-13 2017-10-10 腾讯科技(深圳)有限公司 Using conversion method, device and equipment
CN108268262A (en) * 2017-12-27 2018-07-10 广东耐思尼克信息技术有限公司 Realize the method, apparatus and system that HTML is converted to wechat small routine
CN109710260A (en) * 2018-11-16 2019-05-03 青岛特锐德电气股份有限公司 It is a kind of based on multi-platform applet code converting system and conversion method
CN110704136A (en) * 2019-09-27 2020-01-17 北京百度网讯科技有限公司 Rendering method of small program assembly, client, electronic device and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760762A (en) * 2021-09-08 2021-12-07 北京房江湖科技有限公司 Method for simulating operating environment of applet, electronic device and storage medium
CN113760762B (en) * 2021-09-08 2024-03-08 贝壳找房(北京)科技有限公司 Method for simulating operating environment of applet, electronic device and storage medium
CN114077368A (en) * 2022-01-19 2022-02-22 腾讯科技(深圳)有限公司 Vehicle-mounted applet running method and device, computer equipment and storage medium
CN114077368B (en) * 2022-01-19 2022-06-28 腾讯科技(深圳)有限公司 Vehicle-mounted applet running method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109739478B (en) Front-end project automatic construction method and device, storage medium and electronic equipment
US11550599B2 (en) Method and apparatus for running applet
CN109918166B (en) Applet processing method and device and electronic equipment
CN111338623A (en) Method, device, medium and electronic equipment for developing user interface
CN110895471A (en) Installation package generation method, device, medium and electronic equipment
CN110795649A (en) Target page display method, device and system and electronic equipment
CN113220374A (en) Software processing method and device
CN113536174A (en) Interface loading method, device and equipment
CN115982491A (en) Page updating method and device, electronic equipment and computer readable storage medium
CN111338666A (en) Method, device, medium and electronic equipment for realizing application program upgrading
CN113778393A (en) Component generation method, device, computer system and computer-readable storage medium
CN111367799B (en) Method, device, medium and electronic equipment for locating source code breakdown position
CN110442419B (en) Interface layout method and device for Android application
CN113157274A (en) Software development method and device based on micro front end, electronic equipment and storage medium
CN107092472B (en) Dynamic publishing method and device
CN112235132A (en) Method, device, medium and server for dynamically configuring service
CN111176641A (en) Flow node execution method, device, medium and electronic equipment
CN116069366A (en) Client application program updating method and device, storage medium and electronic equipment
CN110727889A (en) Static webpage resource loading method, device, medium and electronic equipment
CN111400623B (en) Method and device for searching information
CN112596729A (en) Target application interface generation method and device, readable medium and electronic equipment
CN109669720B (en) Chain type asynchronous request processing method and device based on Promise and electronic equipment
CN111782196A (en) MVP architecture-based development method and device
CN114115855A (en) Code multiplexing method and device, computer readable storage medium and electronic equipment
CN114254232A (en) Cloud product page generation method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40051653

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination