CN108647028B - Application information processing method and device - Google Patents

Application information processing method and device Download PDF

Info

Publication number
CN108647028B
CN108647028B CN201810436278.1A CN201810436278A CN108647028B CN 108647028 B CN108647028 B CN 108647028B CN 201810436278 A CN201810436278 A CN 201810436278A CN 108647028 B CN108647028 B CN 108647028B
Authority
CN
China
Prior art keywords
terminal
code
room
application program
engine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810436278.1A
Other languages
Chinese (zh)
Other versions
CN108647028A (en
Inventor
项梦
巫志文
林超
胡越
彭宇洋
黄灿辉
梁兆鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Tencent Technology Co Ltd
Original Assignee
Guangzhou Tencent Technology 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 Guangzhou Tencent Technology Co Ltd filed Critical Guangzhou Tencent Technology Co Ltd
Priority to CN201810436278.1A priority Critical patent/CN108647028B/en
Publication of CN108647028A publication Critical patent/CN108647028A/en
Application granted granted Critical
Publication of CN108647028B publication Critical patent/CN108647028B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides an application information processing method and device, wherein the method comprises the following steps: compiling a source code of an application program by the first terminal, and sending the compiled code to the server side so that a corresponding second terminal can acquire the code from the server side; the first terminal creates a JS engine according to the running environment information of the second terminal; the first terminal injects the compiled code into a JS engine so as to execute a logic part on the compiled code by utilizing the JS engine; and after the second terminal acquires the codes, the first terminal calls a corresponding application program interface of the second terminal to execute a page rendering part on the codes acquired by the second terminal. The method has the advantages that the first terminal executes the logic part, the debugging difficulty can be reduced, and the use threshold of an application program developer can be reduced. The second terminal executes the page rendering part, so that the application program can be debugged in a real machine environment, and the efficiency of developing the application program by an application program developer is effectively improved.

Description

Application information processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing application information.
Background
The applet is an application which can be used without downloading and installing, is available at any time, does not need to install and uninstall, and is popular with users.
When the developer of the applet debugs the applet, if the real environment on the mobile terminal is adopted to debugs the applet, the browser provided by the manufacturer of each large mobile terminal can only truly debugs the JS engine of the company, and some other configuration and use conditions are required, so that the problem that the use threshold is high, which may cause the applet developer to fail to use the JS engine in the browser to debugs the applet.
When the applet is debugged by the applet developer, if the simulation environment on the computer device is adopted, the applet developer may debug normally in the simulation environment due to the difference between the simulation environment and the real environment, and abnormal performance may occur on the real machine of the mobile terminal.
Disclosure of Invention
Embodiments of the present invention aim to solve at least one of the technical problems in the related art in a certain procedure.
Therefore, the embodiment of the invention provides an application program information processing method, so that when an application program is debugged, a JS engine is created by a first terminal according to the running environment information of a second terminal, and then a logic part is executed on a compiled code by the created JS engine, namely, the logic part is executed on the compiled code of the application program by using a simulation environment on the first terminal. The first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when being debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced. In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
The embodiment of the invention provides another application program information processing method.
The embodiment of the invention provides an application information processing device.
The embodiment of the invention provides another application program information processing device.
The embodiment of the invention provides computer equipment.
The embodiment of the invention provides a computer readable storage medium.
In one aspect, an embodiment of the present invention provides an application information processing method, including:
compiling a source code of an application program by a first terminal, and sending the compiled code to a server side so that a corresponding second terminal can acquire the code from the server side;
the first terminal creates a JS engine according to the running environment information of the second terminal;
the first terminal injects the compiled code into the JS engine so as to execute a logic part on the compiled code by utilizing the JS engine;
and after the second terminal acquires the code, the first terminal calls a corresponding application program interface of the second terminal to execute a page rendering part on the code acquired by the second terminal.
According to the application program information processing method, when an application program is debugged, the JS engine is created by the first terminal according to the running environment information of the second terminal, and then the created JS engine is utilized to execute a logic part on the compiled code, namely, the simulation environment on the first terminal is utilized to execute the logic part on the compiled code of the application program, so that the debugging difficulty can be reduced because a real machine environment on the second terminal is not needed to be used for debugging the code logic part of the application program. The first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when being debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced. In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
In another embodiment of the present invention, another method for processing information of an application program is provided, including:
the server side obtains compiled codes from the first terminal; the compiled code is generated after the first terminal compiles the source code of the application program, and is used for the first terminal to build a JS engine according to the running environment information of the corresponding second terminal, and then the compiled code is injected into the JS engine so as to execute a logic part on the compiled code by utilizing the JS engine;
the server stores the compiled codes;
when a second terminal corresponding to the first terminal accesses the server side, the server side provides a stored code for the second terminal;
the code acquired by the second terminal is used for executing a page rendering part on the acquired code when the first terminal calls a corresponding application program interface of the second terminal.
According to the application program information processing method, when an application program is debugged, the JS engine is created by the first terminal according to the running environment information of the second terminal, and then the created JS engine is utilized to execute a logic part on the compiled code, namely, the simulation environment on the first terminal is utilized to execute the logic part on the compiled code of the application program, so that the debugging difficulty can be reduced because a real machine environment on the second terminal is not needed to be used for debugging the code logic part of the application program. The first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when being debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced. In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
An embodiment of another aspect of the present invention provides an application information processing apparatus, where the apparatus is disposed in a first terminal, the apparatus includes:
the compiling module is used for compiling the source code of the application program and sending the compiled code to the server side so that the second terminal corresponding to the first terminal can acquire the code from the server side;
the creating module is used for creating a JS engine according to the running environment information of the second terminal;
the execution module is used for injecting the compiled code into the JS engine by the first terminal so as to execute a logic part on the compiled code by utilizing the JS engine;
and the calling module is used for calling the corresponding application program interface of the second terminal to execute the page rendering part on the code acquired by the second terminal by the first terminal after the code is acquired by the second terminal.
According to the application program information processing device, when an application program is debugged, the JS engine is created by the first terminal according to the running environment information of the second terminal, and then the created JS engine is utilized to execute a logic part on the compiled code, namely, the logic part is executed on the compiled code of the application program by utilizing the simulation environment on the first terminal, and the debugging difficulty can be reduced because the real machine environment on the second terminal is not needed to be used for debugging the code logic part of the application program. The first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when being debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced. In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
In another embodiment of the present invention, another application information processing apparatus is provided, where the apparatus is disposed at a server, and the apparatus includes:
the acquisition module is used for acquiring the compiled codes from the first terminal; the compiled code is generated after the first terminal compiles the source code of the application program, and is used for the first terminal to build a JS engine according to the running environment information of the corresponding second terminal, and then the compiled code is injected into the JS engine so as to execute a logic part on the compiled code by utilizing the JS engine;
the storage module is used for storing the compiled codes;
the access module is used for providing stored codes for the second terminal when the second terminal corresponding to the first terminal accesses the server side;
the code acquired by the second terminal is used for executing a page rendering part on the acquired code when the first terminal calls a corresponding application program interface of the second terminal.
According to the application program information processing device, when an application program is debugged, the JS engine is created by the first terminal according to the running environment information of the second terminal, and then the created JS engine is utilized to execute a logic part on the compiled code, namely, the logic part is executed on the compiled code of the application program by utilizing the simulation environment on the first terminal, and the debugging difficulty can be reduced because the real machine environment on the second terminal is not needed to be used for debugging the code logic part of the application program. The first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when being debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced. In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
In another aspect, an embodiment of the present invention provides a computer device, including: the application information processing method according to the foregoing embodiment of the present invention is implemented by a memory, a processor, and a computer program stored on the memory and executable on the processor when the processor executes the program.
In a further aspect, the present invention provides a computer readable storage medium, on which a computer program is stored, wherein the program is executed by a processor to implement an application information processing method according to the foregoing embodiment of the present invention.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a schematic diagram of a small program architecture in a mobile terminal;
FIG. 2 is a flowchart of an application information processing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an application information handling system according to an embodiment of the present invention;
FIG. 4 is a flowchart of an application information processing method according to a second embodiment of the present invention;
fig. 5 is a schematic diagram illustrating transmission of a signaling message according to an embodiment of the present invention;
fig. 6 is a flowchart of an application information processing method according to a third embodiment of the present invention;
fig. 7 is a flowchart of an application information processing method according to a fourth embodiment of the present invention;
fig. 8 is a flowchart of an application information processing method according to a fifth embodiment of the present invention;
fig. 9 is a schematic structural diagram of an application information processing apparatus according to a sixth embodiment of the present invention;
fig. 10 is a schematic structural diagram of an application information processing apparatus according to a seventh embodiment of the present invention;
FIG. 11 is a schematic diagram of an application information processing apparatus according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an application information processing apparatus according to a ninth embodiment of the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present invention and should not be construed as limiting the invention.
Currently, developers of applets can debug the applets using the real machine environment on the mobile terminal. As shown in FIG. 1, the applet is not a mere web page and native page, but rather a mixture of web pages and native pages. The JS engine of the mobile terminal is JSOORE for the mobile terminal with the operating system being IOS, and V8 for the mobile terminal with the operating system being Android.
Since the browser provided by the manufacturer of each large mobile terminal can only truly co-tune the JS engine of its own company, and there are some conditions of use, for example, for mobile terminals of IOS operating systems, only browser Safari can be used to debug JSCore, and apple developer certificates are also required; for a mobile terminal of an Android operating system, only a browser Chrome can be used for debugging V8, and an overseas server needs to be accessed through a virtual private network (Virtual Private Network, VPN for short), so that a use threshold is too high, and therefore a small program developer cannot use a JS engine in a browser of the mobile terminal to debug the small program.
Alternatively, the applet developer may also use the simulated environment on the computer device to debug the applet, which may cause the applet developer to debug normally in the simulated environment due to differences between the simulated environment and the real environment, while the situation of abnormal performance occurs on the real machine of the mobile terminal.
Therefore, in the embodiment of the invention, when an application program is debugged, a JS engine is created by a first terminal according to the running environment information of a second terminal, and then a compiled code execution logic part is executed by the created JS engine, namely the simulation environment on the first terminal, and when the application program is debugged by using the simulation environment on a computer device in the prior art, the software sensor in the mobile terminal cannot be simulated by the simulation environment, so that the development of the application program is normal in the simulation environment, and the situation of abnormal performance on the true machine of the mobile terminal is caused. The first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when being debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced.
In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
The application information processing method and apparatus according to the embodiments of the present invention are described below with reference to the accompanying drawings. Before describing the embodiments of the present invention in detail, for ease of understanding, the general technical words are first introduced:
the JS engine is a virtual machine that processes JavaScript scripts, and is typically attached to a web browser.
IDE, (Integrated Development Environment ), is application software that assists in developing computer programs.
ES6, ECMAScript version 6, where ECMAScript is a scripting programming language standardized by ECMA (European ComputerManufacturers Association ) through ECMA-262.
ES5, ECMAScript version 5.
BLE, (Bluetooth Low Energy ).
EAP, (Ethernet for Plant Automation ethernet).
USB, (Universal Serial Bus ).
Fig. 2 is a flowchart of an application information processing method according to an embodiment of the invention.
The application information processing method may be executed by the first terminal, and in particular, may be executed by an IDE installed on the first terminal.
An application may refer to a software program running on a hardware device, such as an applet, a small game, etc.
The first terminal may be a hardware device such as a personal computer (Personal Computer, abbreviated as PC), a small computer, a large computer, or the like.
As shown in fig. 2, the application information processing method includes the steps of:
and step 101, compiling the source code of the application program by the first terminal, and sending the compiled code to the server side so that the corresponding second terminal can acquire the code from the server side.
In the embodiment of the invention, the second terminal can be a hardware device with various operating systems, touch screens and/or display screens, such as a mobile phone, a tablet personal computer, a personal digital assistant, a wearable device and the like.
In the embodiment of the invention, the source code of the application program can be written according to the ES6 standard, and the IDE in the first terminal can convert the source code written according to the ES6 standard into the ES5 code with higher support rate because the browser has low support to the ES 6. Thus, the compilation process may include converting ES6 source code into ES5 code.
Further, in order to reduce the volume of the source code, thereby reducing the traffic occupation when the second terminal obtains the code from the server, the compiling process may further include compressing the converted ES5 code.
After compiling the source code of the application program in the IDE in the first terminal, the compiled code may be sent to the server, so that the second terminal may obtain the code from the server side.
And 102, the first terminal creates a JS engine according to the running environment information of the second terminal.
In the embodiment of the invention, since the application program finally needs to run in the second terminal, when the JS engine is created in the simulation environment of the first terminal, the running environment information of the second terminal needs to be considered.
For example, some applications may only run in a higher version of the operating system, and thus, the operating environment information may include operating system version information.
Alternatively, when the application is an applet, since the applet cannot be run alone and needs to run depending on other applications, such as a WeChat, the running environment information of the second terminal may further include version information of the application-dependent program.
In addition, when the application program is an applet, when an applet developer develops the applet, the developer can call a general method in the public library, so that compiling is not required, development efficiency of the applet is improved, and therefore, the operating environment information of the second terminal can further include version information of the applet public library.
As a possible implementation manner, no matter what operating system is adopted by the second terminal, the JS engine in the first terminal may be V8, and it is understood that when the operating environment information of the second terminal is different, there should be a difference between the JS engines created by the IDE in the first terminal.
In the prior art, when the operating systems of the second terminal are different, the created JS engine may be different, for example, when the operating system of the second terminal is Android, the created JS engine may be V8, and when the operating system of the second terminal is IOS, the created JS engine may be JSCore. When the first terminal creates the JS engine instead, it may be unified as V8.
In step 103, the first terminal injects the compiled code into the JS engine to execute the logic portion on the compiled code using the JS engine.
In the embodiment of the present invention, after the JS engine is created by the IDE in the first terminal, the compiled code may be injected into the JS engine, so that the logic portion may be executed on the compiled code by using the JS engine.
In the embodiment of the invention, the IDE in the first terminal executes the logic part of the compiled code by using the created JS engine, namely, the logic part of the compiled code of the application program is executed by using the simulation environment on the first terminal, and the debugging difficulty of the application program can be reduced because the real machine environment on the second terminal is not needed to be used for debugging the code logic part.
Because cross-platform debugging of the JS engine of the second terminal cannot be realized at present, the JS engine set in the second terminal is changed into the JS engine set in the first terminal in the related technology, so that the process of debugging the JS engine of the second terminal is avoided. On the other hand, since the JS engine is configured to parse the execution code to obtain the desired result, where the desired result includes a value, a message, and the like, and the results obtained by running are the same for different platforms of different vendors, although the implementation of the JS engine is different, the second terminal JS engine may be disposed on the first terminal JS engine, so that the code logic portion performed on the first terminal can obtain a result similar to that of the second terminal JS engine in the related art.
In addition, the logic part is executed by the IDE in the first terminal, and the JS engine of the second terminal is not required to be utilized for debugging the logic part, so that the use threshold of an application program developer can be reduced.
And 104, after the second terminal acquires the code, the first terminal calls a corresponding application program interface of the second terminal to execute a page rendering part on the code acquired by the second terminal.
The corresponding application program interface in the second terminal may include an application program interface (Application Programmers Interface, abbreviated as API) of an original control in the application program, and/or an API in a browser WebView tool.
In the embodiment of the invention, after the second terminal obtains the code, if the IDE of the first terminal invokes the corresponding application program interface of the second terminal according to the executed code in the process of executing the compiled code by utilizing the JS engine, the executed code is determined to need to execute the page rendering part, and at this time, the second terminal can execute the page rendering part on the obtained code.
In the embodiment of the invention, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, the development of the application program by the application program developer is possibly caused to be normal in the simulation environment and abnormal in the real machine of the mobile terminal is solved, and the efficiency of developing the application program by the application program developer is effectively improved.
As an example, referring to fig. 3, fig. 3 is a schematic diagram of an application information processing system according to an embodiment of the present invention. And executing a logic part on the compiled code by using the created JS engine by the IDE in the first terminal, and determining that the executed code needs to execute a page rendering part when the IDE calls an API of a native control in an application program in the second terminal, wherein the page rendering part can be executed on the acquired code by the second terminal.
According to the application program information processing method, when an application program is debugged, a JS engine is created by a first terminal according to the running environment information of a second terminal, then a logic part is executed on a compiled code by the created JS engine, namely, the logic part is executed on the compiled code of the application program by using a simulation environment on the first terminal, and the debugging difficulty can be reduced because a true machine environment on the second terminal is not needed to be used for debugging the code logic part of the application program. The IDE in the first terminal executes the logic part, so that the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when the JS engine is debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced.
In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
In order to clearly illustrate the above embodiment, another application information processing method is provided in this embodiment, and fig. 4 is a flowchart of the application information processing method provided in the second embodiment of the present invention.
As shown in fig. 4, the application information processing method may include the steps of:
in step 201, the first terminal compiles the source code of the application program, and sends the compiled code to the server, so that the corresponding second terminal obtains the code from the server.
The execution of step 201 may refer to the execution of step 101 in the above embodiment, which is not described herein.
It should be noted that, the code downloaded from the server side by the second terminal may be only the code of the page rendering portion, so that the traffic occupation when the second terminal obtains the code from the server side may be reduced. Alternatively, the second terminal may also download all the compiled code, so that the second terminal may independently run the code to implement the application function after downloading all the code, which is not limited.
Step 202, after the first terminal obtains the source code of the application program, the first terminal requests to join the debug room from the server side and obtains the room identification of the debug room.
Optionally, in the debugging process, the first terminals and the second terminals are in a one-to-one correspondence, so in the embodiment of the invention, in order to ensure that in the debugging process, the first terminals and the second terminals are always in a one-to-one correspondence, a debugging room can be created, so that only one first terminal and the second terminal corresponding to the first terminal in one debugging room.
Specifically, the IDE in the first terminal may send a request for joining the debug room to the server, and after receiving the request, the server may create a debug room corresponding to the first terminal, and join the first terminal into the debug room. Meanwhile, the server side can send a room identifier of the debug room to the first terminal, wherein the room identifier of the debug room is used for uniquely identifying the debug room. Accordingly, the first terminal can obtain the room identification of the debug room from the server side.
As a possible implementation manner, in order to ensure the reliability and security of the debugging process, when the first terminal requests to join the debugging room, an authentication process needs to be performed on the first terminal. Specifically, the IDE in the first terminal may send a signaling message carrying login authentication information to the server, where the signaling message carrying login authentication information is used for authenticating the first terminal by the server, and when authentication passes, a corresponding debug room is created. After the server side creates the debug room and joins the first terminal in the debug room, the server side may send the room identifier of the debug room to the first terminal, and correspondingly, the first terminal may receive the room identifier of the debug room sent by the server side.
And 203, the first terminal displays the room identifier, so that the second terminal obtains the room identifier and sends the room identifier to the server.
After the first terminal receives the room identification of the debug room, the room identification can be displayed, so that the second terminal can acquire the room identification. After the second terminal obtains the room identifier, the second terminal can send the room identifier to the server, and correspondingly, the server can add the second terminal to a debug room corresponding to the room identifier after receiving the room identifier sent by the second terminal.
Step 204, when the server adds the second terminal into the corresponding debug room according to the room identifier, the first terminal which has added into the debug room establishes communication connection with the second terminal.
In the embodiment of the invention, the communication connection comprises a network connection passing through a server end and a point-to-point connection not passing through the server end.
Wherein, the network connection is used for transmitting at least one of signaling information and data information, and the signaling information is used for maintaining and debugging the room; the data message carries debugging information of the application program; a point-to-point connection for transmitting data messages.
In the embodiment of the present invention, when signaling messages are sent between the first terminal and the second terminal, in order to facilitate real-time monitoring and operation statistics, the signaling messages may be transferred through the server, that is, the signaling messages between the first terminal and the second terminal need to be transmitted through a network connection at the server side.
The data message between the first terminal and the second terminal may be transmitted through a network connection at the server side, or may be transmitted through a point-to-point connection not at the server side, which is not limited.
Optionally, in order to ensure the real-time performance of the data message transmission, the embodiment of the present invention may take the data message between the first terminal and the second terminal as a point-to-point connection that does not pass through the server end for transmission as an example.
Specifically, the point-to-point connection mode may be a connection mode such as a network Socket, EAP, BLE, USB line, and in view of the application scenario and the consideration of the transmission bandwidth, two connection modes of a network Socket and a USB line may be adopted when the application program is debugged.
Among them, the network Socket uses TCP/IP protocol family to communicate, which is the most common communication mode. According to network topology, the network can be divided into an intranet (LAN) and an extranet (WAN), the intranet network condition is relatively stable, the transmission data is relatively high, but the hole punching communication success rate is low in the cross-domain process, and the extranet can be suitable for all network topology structures, so that the intranet or the extranet can be selected according to specific application scenes.
The USB line is in a wired connection mode, has higher stability and faster transmission rate than a network Socket.
It should be noted that, when the application program is debugged, if the second terminal is an Android operating system, the first terminal needs to install a debug bridge tool (Android Debug Bridge, abbreviated as adb) and a driver, and in order to reduce the use threshold of the developer, the adb may be packaged on the IDE of the first terminal. When the first terminal and the second terminal establish communication connection, mapping the designated port of the first terminal to the designated port of the second terminal through an adb reverse command, wherein the first terminal and the second terminal use the designated port to communicate through a network Socket, and the command is as follows:
adb reverse tcp:6666tcp:7777
where 6666 is the port sent by the second terminal and 7777 is the port listened to by the first terminal.
If the second terminal is an IOS operating system, since the IOS operating system has no adb, but the IOS operating system has a usbmux d service similar to the adb, a terminal program may be developed in the first device and packaged into the IDE in order to use the usbmux d service. When the first terminal and the second terminal establish a communication connection, the designated port of the first terminal may be mapped to the designated port of the second terminal by a command as follows:
WARemoreDebugProxy--wxurl=wss://aa.bb.cc:8888—usbprot=1234
where 8888 is the port sent by the second terminal and 1234 is the port listened to by the first terminal.
In step 205, the first terminal obtains the operation environment information of the second terminal through the communication connection.
Optionally, after the first terminal and the second terminal establish a communication connection, the first terminal may acquire the operating environment information of the second terminal through the communication connection.
In step 206, the first terminal creates a JS engine according to the operating environment information of the second terminal.
In step 207, the first terminal injects the compiled code into the JS engine to execute the logic portion on the compiled code using the JS engine.
The execution of steps 206 to 207 can be referred to the execution of steps 102 to 103 in the above embodiment, and will not be described herein.
In step 208, during the first terminal executing the compiled code by using the JS engine, it is determined whether the executed code needs to execute the page rendering portion according to whether the executed code calls an API in the preset list.
The APIs in the preset list comprise APIs of a native control in the application program and/or APIs in a browser WebView tool.
In the embodiment of the invention, when the executed code calls the API in the preset list, the executed code is determined to need to execute the page rendering part, and when the executed code does not call the API in the preset list, the executed code is determined not to need to execute the page rendering part.
As an example, referring to fig. 3, the logic is executed on the compiled code by the IDE in the first terminal using the created JS engine, when the IDE invokes the API of the native control in the application in the second terminal, it is determined that the executed code needs to execute the page rendering portion, at which time the page rendering portion may be executed on the acquired code by the second terminal.
And step 209, if yes, executing a page rendering part after the second terminal acquires the code.
According to the application program information processing method, when an application program is debugged, a JS engine is created by a first terminal according to the running environment information of a second terminal, then a logic part is executed on a compiled code by the created JS engine, namely, the logic part is executed on the compiled code of the application program by using a simulation environment on the first terminal, and the debugging difficulty can be reduced because a true machine environment on the second terminal is not needed to be used for debugging the code logic part of the application program. The IDE in the first terminal executes the logic part, so that the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when the JS engine is debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced.
In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
As a possible implementation manner, after the first terminal establishes a communication connection with the second terminal, if the debugging is completed, the first terminal may send a signaling message for exiting the debugging room to the server side.
The signaling message for exiting the debug room is used for indicating the server to delete the debug room and disconnecting the communication connection between the first terminal and the second terminal.
After the room is created by the IDE in the first terminal, the two-dimension code can be generated, an application program developer can hold the second terminal to scan the two-dimension code on the IDE and enter the room, so that the first terminal and the second terminal can communicate, start joint debugging, then carry out debugging on a logic part and a page rendering part, after the debugging is finished, the first terminal can send a signaling message for exiting the debugging room to the server, and the server deletes the room to finish joint debugging.
Therefore, an application program developer can debug the application program to a common webpage as a true machine only by holding the second terminal to scan the two-dimensional code on the IDE, and the operation is convenient and quick.
As an example, referring to fig. 5, fig. 5 is a schematic diagram illustrating transmission of a signaling message in an embodiment of the present invention. The IDE in the first terminal can send a signaling message to the server, wherein the signaling message carries login authentication information and is used for authenticating the first terminal by the server, and when the authentication of the first terminal passes, the server can create a corresponding debugging room. And the server side can add the first terminal into the debugging room, and the first terminal can display the room identification of the debugging room acquired from the server side, so that the second terminal can add the corresponding debugging room according to the room identification.
When the second terminal joins the commissioning room, the commissioning process may begin. Specifically, the first terminal may establish a communication connection with the second terminal, and obtain the operating environment information of the second terminal through the communication connection, and then create a JS engine according to the operating environment, and execute a logic portion on the compiled code by using the JS engine.
When the first terminal uses the JS engine to execute the compiled code, and calls an API of a native control in the application program and/or an API in a browser WebView tool according to the executed code, the executed code is determined to need to execute the page rendering part, and at the moment, the second terminal can execute the page rendering part.
After the debugging is finished, the first terminal can send a signaling message for exiting the debugging room to the server side, and correspondingly, after the server side receives the signaling message, the debugging room can be deleted, the communication connection between the first terminal and the second terminal is disconnected, and the debugging process is finished.
Fig. 6 is a flowchart of an application information processing method according to a third embodiment of the present invention.
The application information processing method may be executed by a server side.
As shown in fig. 6, the application information processing method may include the steps of:
step 301, a server acquires compiled codes from a first terminal; the compiled code is generated after the first terminal compiles the source code of the application program, and is used for the first terminal to inject the compiled code into the JS engine after creating the JS engine according to the corresponding running environment information of the second terminal so as to execute the logic part on the compiled code by utilizing the JS engine.
In the embodiment of the invention, the source code of the application program can be written according to the ES6 standard, and the browser has low support to the ES6, so that the first terminal can convert the source code written according to the ES6 standard into the ES5 code with higher support rate. That is, the compilation process may include converting ES6 source code into ES5 code.
Further, in order to reduce the volume of the source code, thereby reducing the traffic occupation when the second terminal obtains the code from the server in the subsequent step, the compiling process may further include compressing the converted ES5 code.
After the first terminal compiles the source code of the application program, the first terminal may send the compiled code to the server, and accordingly, the server may obtain the compiled code from the first terminal.
After creating the JS engine according to the corresponding operating environment information of the second terminal, the compiled code is injected into the JS engine, so that the logic portion of the compiled code is executed by the JS engine.
In the embodiment of the invention, the first terminal executes the logic part of the compiled code by using the created JS engine, namely, the logic part of the compiled code of the application program is executed by using the simulation environment on the first terminal, and the debugging difficulty of the code logic part of the application program can be reduced because the real machine environment on the second terminal is not needed to be used.
Because cross-platform debugging of the JS engine of the second terminal cannot be realized at present, the JS engine set in the second terminal is changed into the JS engine set in the first terminal in the related technology, so that the process of debugging the JS engine of the second terminal is avoided. On the other hand, since the JS engine is configured to parse the execution code to obtain the desired result, where the desired result includes a value, a message, and the like, and the results obtained by running are the same for different platforms of different vendors, although the implementation of the JS engine is different, the second terminal JS engine may be disposed on the first terminal JS engine, so that the code logic portion performed on the first terminal can obtain a result similar to that of the second terminal JS engine in the related art.
In addition, the first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and the use threshold of an application program developer can be reduced.
Step 302, the server stores the compiled code.
In the embodiment of the invention, after receiving the compiled code, the server side can store the compiled code, so that the second client side can acquire the compiled code from the data stored in the server side in the subsequent step.
Step 303, when the second terminal corresponding to the first terminal accesses the server, the server provides the stored code to the second terminal.
The second terminal is used for executing a page rendering part on the acquired codes when the first terminal calls the corresponding application program interface of the second terminal.
Alternatively, when the second terminal accesses the server side, the server side may provide the stored code to the second terminal.
As a possible implementation manner, the code provided by the server side to the second terminal may be only the code of the page rendering portion, so that traffic occupation when the second terminal performs code acquisition from the server side may be reduced.
As another possible implementation manner, the code provided by the server side to the second terminal may be all compiled code, so that after the second terminal downloads all the code, the code may be independently run to implement the application function.
When the first terminal invokes a corresponding application program interface of the second terminal according to the executed code in the process of executing the compiled code by using the JS engine, wherein the corresponding application program interface in the second terminal comprises an application program interface (Application Programmers Interface, abbreviated as API) of a native control in an application program, and/or an API in a browser WebView tool determines that the executed code needs to execute a page rendering part, and at this time, the second terminal can execute the page rendering part on the acquired code.
In the embodiment of the invention, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, the development of the application program by the application program developer is possibly caused to be normal in the simulation environment and abnormal in the real machine of the mobile terminal is solved, and the efficiency of developing the application program by the application program developer is effectively improved.
According to the application program information processing method, when an application program is debugged, a JS engine is created by a first terminal according to the running environment information of a second terminal, then a logic part is executed on a compiled code by the created JS engine, namely, the logic part is executed on the compiled code of the application program by using a simulation environment on the first terminal, and the debugging difficulty can be reduced because a true machine environment on the second terminal is not needed to be used for debugging the code logic part of the application program. The IDE in the first terminal executes the logic part, so that the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when the JS engine is debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced.
In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
In order to clearly illustrate the above embodiment, another application information processing method is provided in this embodiment, and fig. 7 is a flowchart of the application information processing method provided in the fourth embodiment of the present invention.
As shown in fig. 7, the application information processing method may include the steps of:
step 401, after receiving a request sent by a first terminal, a server creates a debug room corresponding to the first terminal, and joins the first terminal into the debug room.
Optionally, in the debugging process, the first terminals and the second terminals are in a one-to-one correspondence, so in the embodiment of the invention, in order to ensure that in the debugging process, the first terminals and the second terminals are always in a one-to-one correspondence, a debugging room can be created, so that only one first terminal and one second terminal corresponding to the first terminal in one debugging room.
Specifically, the first terminal may send a request for joining the debug room to the server, and after receiving the request, the server may create a debug room corresponding to the first terminal, and join the first terminal into the debug room.
As a possible implementation manner, in order to ensure the reliability and security of the debugging process, when the first terminal requests to join the debugging room, an authentication process needs to be performed on the first terminal. Specifically, the first terminal may send a signaling message carrying login authentication information to the server, where the signaling message carrying login authentication information is used for authenticating the first terminal by the server, and when authentication passes, a corresponding debug room is created.
Step 402, the server side sends the room identifier of the debug room to the first terminal, so that the first terminal displays the room identifier.
Optionally, after the server side creates the debug room and joins the first terminal to the debug room, the server side may send a room identifier of the debug room to the first terminal, and correspondingly, the first terminal may receive the room identifier of the debug room sent by the server side, where the room identifier of the debug room is used to uniquely identify the debug room. After the first terminal receives the room identification of the debug room, the room identification can be displayed, so that the second terminal can acquire the room identification.
And step 403, when the server receives the room identifier sent by the second terminal, the second terminal is added into the corresponding debugging room, so that the first terminal added into the same debugging room and the second terminal are in communication connection.
Optionally, after the second terminal obtains the room identifier, the second terminal may send the room identifier to the server, and correspondingly, after receiving the room identifier sent by the second terminal, the server may add the second terminal to a debug room corresponding to the room identifier, so that the first terminal added to the same debug room may establish communication connection with the second terminal.
Step 404, the server obtains the compiled code from the first terminal; the compiled code is generated after the first terminal compiles the source code of the application program, and is used for the first terminal to inject the compiled code into the JS engine after creating the JS engine according to the corresponding running environment information of the second terminal so as to execute the logic part on the compiled code by utilizing the JS engine.
The execution of step 404 may refer to the execution of step 301 in the above embodiment, and will not be described herein.
In step 405, the server performs code merging on the compiled code.
In the embodiment of the invention, the server side can carry out code combination on the compiled codes, wherein the combined codes are used for breakpoint debugging of the second terminal.
In step 406, the server stores the combined codes.
In step 407, when the second terminal corresponding to the first terminal accesses the server, the server provides the stored code to the second terminal.
In the embodiment of the invention, the codes stored in the server are combined codes, so that when the second terminal receives the codes from the server, the traffic occupation can be reduced.
As a possible implementation manner, the code provided by the server side to the second terminal may be only the code of the page rendering portion, so that traffic occupation when the second terminal performs code acquisition from the server side may be reduced.
As another possible implementation manner, the code provided by the server side to the second terminal may be all the combined codes, so that after the second terminal downloads all the codes, the codes may be independently run to implement the application program function.
According to the application program information processing method, when an application program is debugged, a JS engine is created by a first terminal according to running environment information of a second terminal, then a logic part is executed on a compiled code by the created JS engine, namely, the logic part is executed on the compiled code of the application program by using a simulation environment on the first terminal, and the debugging difficulty can be reduced because a true machine environment on the second terminal is not needed to be used for debugging the code logic part of the application program. The logical part is executed in the first terminal, the JS engine of the second terminal is not required to be used for debugging the logical part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that a developer certificate is required for debugging the JS engine at the second terminal is avoided, and the use threshold of an application program developer is reduced.
In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
Fig. 8 is a flowchart of an application information processing method according to a fifth embodiment of the present invention.
As shown in fig. 8, the application information processing method may include the steps of:
in step 501, the first terminal compiles source code of an application program.
In step 502, the first terminal sends the compiled code to the server.
In step 503, the first terminal requests to join the debug room from the server side.
Step 504, after receiving the request sent by the first terminal, the server creates a debug room corresponding to the first terminal.
Step 505, the server joins the first terminal into the debug room, and sends the room identifier of the debug room to the first terminal.
And 506, the first terminal acquires the room identification of the debug room and displays the room identification.
In step 507, the second terminal obtains a room identification.
And step 508, the second terminal sends the room identification to the server side.
Step 509, the server adds the second terminal to the corresponding debug room according to the room identifier.
In step 510, the first terminal establishes a communication connection with the second terminal.
In step 511, the first terminal obtains the operating environment information of the second terminal through the communication connection.
In step 512, the first terminal creates a JS engine according to the operating environment information of the second terminal.
In step 513, the first terminal injects the compiled code into the JS engine to execute the logic portion on the compiled code using the JS engine.
The server receives the compiled code and performs code merging on the compiled code, step 514.
It should be noted that, steps 514 to 517 may be performed after step 502, and the embodiment of the present invention is only illustrated by step 514 after step 513.
In step 515, the server stores the combined code.
In step 516, the second terminal accesses the server side.
In step 517, the second terminal obtains the stored code from the server.
In step 518, the first terminal invokes the corresponding application program interface of the second terminal to execute the page rendering portion on the code acquired by the second terminal.
In step 519, after the debugging is completed, the first terminal sends a signaling message for exiting the debugging room to the server.
Step 520, the server deletes the debug room, and disconnects the communication connection between the first terminal and the second terminal.
It should be noted that the explanation of the application information processing method in the embodiments of fig. 2 to 7 is also applicable to the application information processing method in this embodiment, and will not be repeated here.
According to the application program information processing method, when an application program is debugged, the JS engine is created by the first terminal according to the running environment information of the second terminal, then the created JS engine is utilized to execute a logic part on the compiled code, namely, the simulation environment on the first terminal is utilized to execute the logic part on the compiled code of the application program, and the debugging difficulty can be reduced because a real machine environment on the second terminal is not needed to be used for debugging the code logic part on the application program. The first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when being debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced.
In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
In order to achieve the above embodiment, the present invention also proposes an application information processing apparatus.
Fig. 9 is a schematic structural diagram of an application information processing apparatus according to a sixth embodiment of the present invention.
As shown in fig. 9, the application information processing apparatus 100 is provided in a first terminal, and includes: a compiling module 101, a creating module 102, an executing module 103, and a calling module 104. Wherein,
the compiling module 101 is configured to compile a source code of an application program, and send the compiled code to a server side, so that a second terminal corresponding to the first terminal obtains the code from the server side.
The creating module 102 is configured to create a JS engine according to the operating environment information of the second terminal.
As one possible implementation, when the application is an applet, the running environment information includes: one or more of operating system version information, application dependent version information, and applet common library version information.
The execution module 103 is configured to inject the compiled code into the JS engine by using the first terminal, so as to execute the logic portion on the compiled code by using the JS engine.
And the calling module 104 is used for calling the corresponding application program interface of the second terminal to execute the page rendering part on the code acquired by the second terminal by the first terminal after the code is acquired by the second terminal.
Further, in one possible implementation manner of the embodiment of the present invention, referring to fig. 10, on the basis of the embodiment shown in fig. 9, the application information processing apparatus 100 may further include:
and the request module 105 is configured to request to join the debug room from the server side and obtain a room identifier of the debug room after acquiring the source code of the application program before creating the JS engine according to the operating environment information of the second terminal.
As a possible implementation manner, the request module 105 is specifically configured to send a signaling message carrying login authentication information to the server side; the signaling message carrying login authentication information is used for authenticating the first terminal by the server side and creating a corresponding debugging room when authentication is passed; after the server side creates the debug room and joins the first terminal into the debug room, the first terminal receives a signaling message sent by the server side and used for indicating the room identification of the debug room.
And the display module 106 is configured to display the room identifier, so that the second terminal obtains the room identifier and sends the room identifier to the server.
The establishing module 107 is configured to establish a communication connection between the first terminal and the second terminal that have joined the debug room after the server joins the second terminal to the corresponding debug room according to the room identifier.
In the embodiment of the invention, the communication connection comprises a network connection passing through a server end and a point-to-point connection not passing through the server end.
Wherein the network connection is used for transmitting at least one of a signaling message and a data message; the signaling message is used for maintaining and debugging the room; the data message carries debugging information of the application program; a point-to-point connection for transmitting data messages.
And the obtaining module 108 is configured to obtain the operating environment information of the second terminal through the communication connection.
An exit module 109, configured to send a signaling message for exiting the debug room to the server after the completion of the debugging after the communication connection between the first terminal and the second terminal that have joined the debug room is established; and the signaling message is used for exiting the debugging room, is used for indicating the server side to delete the debugging room and disconnects the communication connection between the first terminal and the second terminal.
The determining module 110 is configured to determine, before invoking a corresponding application program interface of the second terminal to execute the page rendering portion on the code acquired by the second terminal, whether the executed code needs to execute the page rendering portion according to whether the executed code invokes an API in a preset list in a process of executing the compiled code by the first terminal using the JS engine.
The APIs in the preset list comprise APIs of a native control in the application program and/or APIs in a browser WebView tool.
It should be noted that the explanation of the embodiment of the application information processing method shown in fig. 2 to 5 is also applicable to the application information processing apparatus 100 of this embodiment, and is not repeated here.
According to the application program information processing method, when an application program is debugged, the JS engine is created by the first terminal according to the running environment information of the second terminal, then the created JS engine is utilized to execute a logic part on the compiled code, namely, the simulation environment on the first terminal is utilized to execute the logic part on the compiled code of the application program, and the debugging difficulty can be reduced because a real machine environment on the second terminal is not needed to be used for debugging the code logic part on the application program. The first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when being debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced.
In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
Fig. 11 is a schematic structural diagram of an application information processing apparatus according to an embodiment of the present invention.
As shown in fig. 11, the application information processing apparatus 200, provided at a server side, includes: an acquisition module 201, a storage module 202, and an access module 203. Wherein,
an obtaining module 201, configured to obtain a compiled code from a first terminal; the compiled code is generated after the first terminal compiles the source code of the application program, and is used for the first terminal to inject the compiled code into the JS engine after creating the JS engine according to the corresponding running environment information of the second terminal so as to execute the logic part on the compiled code by utilizing the JS engine.
The storage module 202 is configured to store the compiled code.
And the access module 203 is configured to provide the stored code to the second terminal when the second terminal corresponding to the first terminal accesses the server.
The second terminal is used for executing a page rendering part on the acquired codes when the first terminal calls the corresponding application program interface of the second terminal.
Further, in one possible implementation manner of the embodiment of the present invention, referring to fig. 12, on the basis of the embodiment shown in fig. 11, the application information processing apparatus 200 may further include:
the merging module 204 is configured to merge the compiled code before storing the compiled code.
The creation module 205 is configured to create a debug room corresponding to the first terminal after receiving a request sent by the first terminal before acquiring the compiled code from the first terminal, and add the first terminal into the debug room.
And the sending module 206 is configured to send the room identifier of the debug room to the first terminal, so that the first terminal displays the room identifier.
And the joining module 207 is configured to join the second terminal into a corresponding debug room when receiving the room identifier sent by the second terminal, so that the first terminal joining the same debug room and the second terminal establish communication connection.
It should be noted that the explanation of the embodiment of the application information processing method shown in fig. 6 to 7 is also applicable to the application information processing apparatus 200 of this embodiment, and will not be repeated here.
According to the application program information processing method, when an application program is debugged, the JS engine is created by the first terminal according to the running environment information of the second terminal, then the created JS engine is utilized to execute a logic part on the compiled code, namely, the simulation environment on the first terminal is utilized to execute the logic part on the compiled code of the application program, and the debugging difficulty can be reduced because a real machine environment on the second terminal is not needed to be used for debugging the code logic part on the application program. The first terminal executes the logic part, the JS engine of the second terminal is not required to be utilized for debugging the logic part, and meanwhile, the same result as that obtained by debugging the JS engine at the second terminal can be obtained, the limitation that the JS engine needs a developer certificate when being debugged at the second terminal is avoided, and the use threshold of an application program developer is reduced.
In addition, the second terminal executes the page rendering part on the acquired code, and the application program can be debugged in the real machine environment, so that the technical problem that in the prior art, due to the difference between the simulation environment and the real environment, a developer of the small program can debug normally in the simulation environment and the situation that the real machine of the mobile terminal shows abnormality occurs can be solved, and the efficiency of the application program developer to develop the application program is effectively improved.
In order to implement the above embodiment, the present invention further proposes a computer device including: the application information processing method according to the foregoing embodiment of the present invention is implemented by a memory, a processor, and a computer program stored on the memory and executable on the processor, when the processor executes the program.
In order to achieve the above-described embodiments, the present invention also proposes a computer-readable storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements an application information processing method as proposed in the foregoing embodiments of the present invention.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order from that shown or discussed, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present invention.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.

Claims (14)

1. An application information processing method, characterized in that the method comprises the steps of:
compiling a source code of an application program by a first terminal, and sending the compiled code to a server side so that a corresponding second terminal can acquire the code from the server side;
the first terminal creates a JS engine according to the running environment information of the second terminal; the running environment information comprises one or more of operating system version information, version information of the application dependent program and version information of an applet public library;
the first terminal injects the compiled code into the JS engine so as to execute a logic part on the compiled code by utilizing the JS engine;
and after the second terminal acquires the code, the first terminal calls a corresponding application program interface of the second terminal to execute a page rendering part on the code acquired by the second terminal.
2. The application information processing method according to claim 1, wherein before the first terminal creates the JS engine according to the operating environment information of the second terminal, further comprising:
after the first terminal acquires the source code of the application program, requesting to join in a debugging room from the server side and acquiring a room identifier of the debugging room;
the first terminal displays the room identifier so that the second terminal obtains the room identifier and sends the room identifier to the server;
when the server adds the second terminal into a corresponding debugging room according to the room identifier, a first terminal which is added into the debugging room and the second terminal are in communication connection;
and the first terminal acquires the operation environment information of the second terminal through the communication connection.
3. The application information processing method according to claim 2, wherein after the first terminal obtains the source code of the application, requesting to join a debug room from the server side and obtaining a room identification of the debug room, comprises:
the first terminal sends a signaling message carrying login authentication information to the server side; the signaling message carrying login authentication information is used for authenticating the first terminal by the server side, and when authentication passes, a corresponding debugging room is created;
After the server side creates the debugging room and joins the first terminal into the debugging room, the first terminal receives a signaling message sent by the server side and used for indicating the room identification of the debugging room.
4. The application information processing method according to claim 2, characterized in that after the first terminal that has joined the debug room establishes a communication connection with the second terminal, further comprising:
after the debugging is finished, the first terminal sends a signaling message for exiting the debugging room to the server side; the signaling message for exiting the debug room is used for indicating the server to delete the debug room and disconnecting the communication connection between the first terminal and the second terminal.
5. The application information processing method according to claim 2, wherein the communication connection includes a network connection through the server side and a point-to-point connection not through the server side;
wherein the network connection is used for transmitting at least one of a signaling message and a data message; the signaling message is used for maintaining the debug room; the data message carries debugging information of an application program;
The point-to-point connection is used for transmitting the data message.
6. The application information processing method according to any one of claims 1 to 5, characterized in that before the first terminal invokes the corresponding application program interface of the second terminal to execute the page rendering portion on the code acquired by the second terminal, further comprising:
in the process that the first terminal executes the compiled code by utilizing the JS engine, determining whether the executed code needs to execute a page rendering part according to whether the executed code calls an API in a preset list;
the APIs in the preset list comprise APIs of a native control in the application program and/or APIs in a browser WebView tool.
7. The application information processing method according to any one of claims 1 to 5, wherein the application includes an applet.
8. An application information processing method, characterized in that the method comprises the steps of:
the server side obtains compiled codes from the first terminal; the compiled code is generated after the first terminal compiles the source code of the application program, and is used for the first terminal to build a JS engine according to the running environment information of the corresponding second terminal, and then the compiled code is injected into the JS engine so as to execute a logic part on the compiled code by utilizing the JS engine; the running environment information comprises one or more of operating system version information, version information of the application dependent program and version information of an applet public library;
The server stores the compiled codes;
when a second terminal corresponding to the first terminal accesses the server side, the server side provides a stored code for the second terminal;
the code acquired by the second terminal is used for executing a page rendering part on the acquired code when the first terminal calls a corresponding application program interface of the second terminal.
9. The application information processing method according to claim 8, wherein before the server side stores the compiled code, further comprising:
and the server performs code merging on the compiled codes.
10. The application information processing method according to claim 8, wherein before the server side obtains the compiled code from the first terminal, further comprising:
after receiving the request sent by the first terminal, the server side creates a debugging room corresponding to the first terminal, and adds the first terminal into the debugging room;
the server side sends the room identification of the debugging room to the first terminal so that the first terminal displays the room identification;
When the server receives the room identification sent by the second terminal, the second terminal is added into a corresponding debugging room, so that the first terminal added into the same debugging room and the second terminal are in communication connection.
11. An application information processing apparatus, the apparatus being provided in a first terminal, the apparatus comprising:
the compiling module is used for compiling the source code of the application program and sending the compiled code to the server side so that the second terminal corresponding to the first terminal can acquire the code from the server side;
the creating module is used for creating a JS engine according to the running environment information of the second terminal; the running environment information comprises one or more of operating system version information, version information of the application dependent program and version information of an applet public library;
the execution module is used for injecting the compiled code into the JS engine by the first terminal so as to execute a logic part on the compiled code by utilizing the JS engine;
and the calling module is used for calling the corresponding application program interface of the second terminal to execute the page rendering part on the code acquired by the second terminal by the first terminal after the code is acquired by the second terminal.
12. An application information processing apparatus, wherein the apparatus is provided at a server side, the apparatus comprising:
the acquisition module is used for acquiring the compiled codes from the first terminal; the compiled code is generated after the first terminal compiles the source code of the application program, and is used for the first terminal to build a JS engine according to the running environment information of the corresponding second terminal, and then the compiled code is injected into the JS engine so as to execute a logic part on the compiled code by utilizing the JS engine; the running environment information comprises one or more of operating system version information, version information of the application dependent program and version information of an applet public library;
the storage module is used for storing the compiled codes;
the access module is used for providing stored codes for the second terminal when the second terminal corresponding to the first terminal accesses the server side;
the code acquired by the second terminal is used for executing a page rendering part on the acquired code when the first terminal calls a corresponding application program interface of the second terminal.
13. A computer device, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, which processor implements the application information processing method according to any one of claims 1-7 or implements the application information processing method according to any one of claims 8-10 when executing the program.
14. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the application information processing method according to any one of claims 1 to 7, or implements the application information processing method according to any one of claims 8 to 10.
CN201810436278.1A 2018-05-09 2018-05-09 Application information processing method and device Active CN108647028B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810436278.1A CN108647028B (en) 2018-05-09 2018-05-09 Application information processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810436278.1A CN108647028B (en) 2018-05-09 2018-05-09 Application information processing method and device

Publications (2)

Publication Number Publication Date
CN108647028A CN108647028A (en) 2018-10-12
CN108647028B true CN108647028B (en) 2024-02-09

Family

ID=63749708

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810436278.1A Active CN108647028B (en) 2018-05-09 2018-05-09 Application information processing method and device

Country Status (1)

Country Link
CN (1) CN108647028B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726129B (en) * 2018-12-29 2022-08-12 北京小米移动软件有限公司 Code segment operation method, device, terminal and storage medium
CN111414301B (en) * 2019-01-07 2023-06-20 阿里巴巴集团控股有限公司 Method and device for debugging application program
CN109800101A (en) * 2019-02-01 2019-05-24 北京字节跳动网络技术有限公司 Report method, device, terminal device and the storage medium of small routine abnormal conditions
CN110083399B (en) * 2019-03-04 2021-06-22 上海连尚网络科技有限公司 Applet running method, computer device and storage medium
CN111796799B (en) * 2019-04-09 2021-09-07 广州腾讯科技有限公司 Sub-application development method and device, computer equipment and storage medium
CN110287106B (en) * 2019-05-24 2023-09-26 北京达佳互联信息技术有限公司 Method and device for debugging shader code, electronic equipment and storage medium
CN110532181A (en) * 2019-08-19 2019-12-03 广州华旻信息科技有限公司 ES6 characteristic compatibility detection system and method
CN110688175A (en) * 2019-10-09 2020-01-14 网易(杭州)网络有限公司 File loading method and device, terminal equipment and storage medium
CN112671814B (en) * 2019-10-15 2022-04-12 北京奇艺世纪科技有限公司 Cross-platform equipment development method, device and system
CN110837473B (en) * 2019-11-07 2023-08-22 腾讯科技(深圳)有限公司 Application program debugging method, device, terminal and storage medium
CN111338633B (en) * 2020-02-10 2023-08-15 Oppo(重庆)智能科技有限公司 Method and device for generating installation-free file and electronic equipment
CN111782218B (en) * 2020-06-29 2024-03-01 百度在线网络技术(北京)有限公司 Applet processing method, device, equipment and storage medium
CN113971124A (en) * 2020-07-24 2022-01-25 腾讯科技(深圳)有限公司 Debugging method and device of sub-application, computer equipment and storage medium
CN112445712B (en) * 2020-12-10 2024-02-27 北京信而泰科技股份有限公司 Method and device for generating test source code
CN116257244B (en) * 2022-09-06 2023-10-03 无锡芯享信息科技有限公司 Flow code conversion system for chip manufacturing EAP system
CN117435244B (en) * 2023-12-21 2024-03-19 南京掌控网络科技有限公司 Front-end engineering-crossing public library system and construction method thereof

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102393820A (en) * 2011-11-09 2012-03-28 国电南瑞科技股份有限公司 Logical implementation method for controlling building monitoring system
CN103441900A (en) * 2013-08-27 2013-12-11 上海新炬网络技术有限公司 Centralization cross-platform automated testing system and control method thereof
CN103677839A (en) * 2013-12-17 2014-03-26 深圳市迈桥科技有限公司 Generating method and device of UI control across mobile terminal
CN104077225A (en) * 2014-07-04 2014-10-01 用友软件股份有限公司 Script debugging method and script debugging device both based on JavaScript
CN104123157A (en) * 2014-07-17 2014-10-29 北京京东尚科信息技术有限公司 Method and device for customizing cross-platform business logic of mobile terminal
CN104683571A (en) * 2015-02-05 2015-06-03 杭州曼拓科技有限公司 Universal control method for intelligent mobile equipment
CN104679644A (en) * 2013-11-28 2015-06-03 比亚迪股份有限公司 Testing method and system for application program in mobile terminal
CN104714830A (en) * 2015-04-03 2015-06-17 普元信息技术股份有限公司 System and method for achieving cross-platform application development based on native development language
US9348569B1 (en) * 2012-09-11 2016-05-24 Emc Corporation Method and system for a configurable automation framework
CN106775862A (en) * 2016-12-08 2017-05-31 蓝信工场(北京)科技有限公司 Using loading method and device
CN107315576A (en) * 2016-04-26 2017-11-03 中兴通讯股份有限公司 A kind of method and system of dynamic expansion software flow
CN107451162A (en) * 2016-06-01 2017-12-08 广州市动景计算机科技有限公司 Network resource accession equipment, mixing apparatus and method
CN107908402A (en) * 2017-08-15 2018-04-13 口碑(上海)信息技术有限公司 The hot restorative procedure of Java server-sides and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9558020B2 (en) * 2014-09-17 2017-01-31 International Business Machines Corporation Method of processing javascript (JS) API requests
US10368121B2 (en) * 2014-11-07 2019-07-30 Roku, Inc. System and method for collecting data

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102393820A (en) * 2011-11-09 2012-03-28 国电南瑞科技股份有限公司 Logical implementation method for controlling building monitoring system
US9348569B1 (en) * 2012-09-11 2016-05-24 Emc Corporation Method and system for a configurable automation framework
CN103441900A (en) * 2013-08-27 2013-12-11 上海新炬网络技术有限公司 Centralization cross-platform automated testing system and control method thereof
CN104679644A (en) * 2013-11-28 2015-06-03 比亚迪股份有限公司 Testing method and system for application program in mobile terminal
CN103677839A (en) * 2013-12-17 2014-03-26 深圳市迈桥科技有限公司 Generating method and device of UI control across mobile terminal
CN104077225A (en) * 2014-07-04 2014-10-01 用友软件股份有限公司 Script debugging method and script debugging device both based on JavaScript
CN104123157A (en) * 2014-07-17 2014-10-29 北京京东尚科信息技术有限公司 Method and device for customizing cross-platform business logic of mobile terminal
CN104683571A (en) * 2015-02-05 2015-06-03 杭州曼拓科技有限公司 Universal control method for intelligent mobile equipment
CN104714830A (en) * 2015-04-03 2015-06-17 普元信息技术股份有限公司 System and method for achieving cross-platform application development based on native development language
CN107315576A (en) * 2016-04-26 2017-11-03 中兴通讯股份有限公司 A kind of method and system of dynamic expansion software flow
CN107451162A (en) * 2016-06-01 2017-12-08 广州市动景计算机科技有限公司 Network resource accession equipment, mixing apparatus and method
CN106775862A (en) * 2016-12-08 2017-05-31 蓝信工场(北京)科技有限公司 Using loading method and device
CN107908402A (en) * 2017-08-15 2018-04-13 口碑(上海)信息技术有限公司 The hot restorative procedure of Java server-sides and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
微信小程序开发调试工具;飞跃的技术博客;《https://www.cnblogs.com/minyifei/p/6244790.html》;第1-3页 *

Also Published As

Publication number Publication date
CN108647028A (en) 2018-10-12

Similar Documents

Publication Publication Date Title
CN108647028B (en) Application information processing method and device
US8612947B2 (en) System and method for remotely compiling multi-platform native applications for mobile devices
CN106294102B (en) Application program testing method, client, server and system
US20080209405A1 (en) Distributed debugging for a visual programming language
CN108964993B (en) Fault simulation method, device and equipment based on dynamic proxy and readable storage medium
CN102955698A (en) Processing method and device based on multi-terminal software development
WO2017028574A1 (en) Router testing method and testing device
EP4148585A1 (en) Application debugging method and system, and device and medium
CN112953983A (en) SFTP transmission method and device
CN110908704A (en) Method and device for calling cross-platform native function of mobile terminal
CN113641582A (en) Mixed-mode mobile application debugging method and system
CN115658042A (en) Hybrid application component type development method, system, device and storage medium
CN110795353A (en) Debugging method, device and equipment for fast application and storage medium
CN111050333A (en) Base station automatic test method and system
CN104536765A (en) Embedded device logging-in and debugging method and system
CN106776310B (en) Debugging method and debugging device
CN113709243A (en) Equipment remote control method and device, electronic equipment and storage medium
CN116755788A (en) On-line rule modification method, device, equipment and storage medium
CN112433938A (en) Method and device for testing application of mobile terminal
CN113342356A (en) Client framework operation and management configuration method
CN112685048A (en) Application program packaging method, electronic device and storage medium
CN111399824A (en) Component port implementation method and terminal based on hybrid transmission mechanism
CN111611148A (en) Compatibility concurrent testing method and system for iOS system application software
CN116991816B (en) Log output method, device, electronic equipment and storage medium
CN110633095B (en) System and method for software development

Legal Events

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