Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram 100 of one application scenario of a method for displaying application information, in accordance with some embodiments of the present disclosure.
As shown in fig. 1, an execution subject (for example, the server 102 in fig. 1) of the method for displaying application information detects a click operation for an operation marker indicated by reference numeral 1011 in the display terminal 101 (for example, shown as a computer in fig. 1), and the server 102 obtains the source code 103. Server 102 determines the programming language 1021 of source code 103. Server 102 selects an image (e.g., image 1023 in fig. 1) from image store 1022 that corresponds to programming language 1021. The server 102 performs the steps shown by reference numeral 1026 based on the image 1023, resulting in an output result 104 (e.g., "big home!!!" in FIG. 1). The server 102 returns the output result 104 to the display terminal 101, and controls the display terminal 101 to display in the display interface 1012.
It is understood that the method for displaying the application information is executed by the server 102, or may be executed by the terminal device 101, and the execution main body of the method may further include a device formed by integrating the terminal device 101 and the server 102 through a network, or may also be executed by various software programs. The terminal device 101 may be various electronic devices with information processing capability, including but not limited to a smart phone, a tablet computer, an e-book reader, a laptop portable computer, a desktop computer, and the like. Furthermore, the execution body may also be embodied as a server, software, or the like. When the execution subject is software, the software can be installed in the electronic device listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computers, servers in FIG. 1 is merely illustrative. There may be any number of computers and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a method for displaying application information in accordance with the present disclosure is shown. The method for displaying application information comprises the following steps:
step 201, in response to detecting a target operation for an application, acquiring a source code of the application.
In some embodiments, an execution subject (e.g., a server shown in fig. 1) of the method for displaying application information may obtain a source code of an application from a terminal that detects a target operation for the application through a wired connection manner or a wireless connection manner. The application may be a written program. The above target operation may include at least one of: and deploying operation and running operation. As an example, when a user performs an operation on a written program, the execution main body may obtain the code of the program from a terminal on which the program is executed. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
At step 202, the programming language of the source code is determined.
In some embodiments, based on the source code obtained in step 201, the execution body may determine a programming language of the source code according to a syntax and a command format of the code in the source code. The programming languages described above are typically formal languages used to define computer programs. For example, the programming language may be one of: c language (C programming language), Java (computer programming language), Perl language (Practical Extraction and report language), and Python (computer programming language). As an example, since there is a difference between the language syntax and the naming format of each programming language, the execution body may determine the programming language of the source code in the language syntax and the naming format of the source code.
In some optional implementations of some embodiments, the determining the programming language of the source code includes: determining whether the source code comprises a keyword corresponding to a target language; and in response to the determination, determining the programming language of the source code as the target language. As an example, the execution agent may establish a correspondence table of a programming language and a keyword unique to each programming. The execution subject may determine the programming language of the source code according to the correspondence table.
In some optional implementations of some embodiments, the determining the programming language of the source code includes: and determining the programming language type of the source code according to codes contained in codes of a preset line of the source code. As an example, the execution subject may determine the programming language based on the first line of code of the source code obtained in 201. For example, the first line code may be "<! DOCTYPE HTML >, the programming language for the source code may be HTML5(HTML 5.0).
And step 203, acquiring the mirror image corresponding to the programming language from the mirror image warehouse.
In some embodiments, the execution agent may obtain an image corresponding to the programming language from an image repository. The mirror image warehouse is used for storing mirror images. The image contains the operating system, runtime environment, and application programs needed by the application runtime and can be used to deploy the cluster or create the container instance. The mirror image is a layer-type structure based on a union (union) file system, and is constructed by a series of instructions step by step, and the container is started based on the mirror image. The container is a light weight runtime environment. Under the environment, the application can obtain files, variables and information bases required by the operation of the application, so that the portability is realized to the maximum extent. By way of example, the image may be downloaded by the user from the network, or may be built locally by the user himself. For example, the programming language of the source code is Java language, and an image of Java language is selected from the image repository.
In some optional implementations of some embodiments, the mirror repository includes any one of: private image library, public image library. The private image library is usually built on the terminal equipment by the user. The public image library is typically downloaded from a network.
In some optional implementations of some embodiments, reference may further be made to fig. 3, which illustrates an exemplary flow 300 of generating steps of an image in an image repository, according to some embodiments of the present disclosure. As shown in fig. 3, the mirror image in the mirror image warehouse is obtained by the following steps:
step 301, selecting the corresponding configuration script according to the programming language.
In some embodiments, the execution subject may obtain the configuration script corresponding to the programming language from the programming language of the source code determined in step 202 through various ways. The above-mentioned various ways may be configuration scripts downloaded from a network, or may be built locally by the user. The configuration script is automatically searched by the source code during configuration.
And 302, compiling the source code based on the configuration script to generate a target code.
In some embodiments, the execution subject compiles the source code to generate a target code based on the configuration script obtained in step 301. The compiling is a process of changing a high-level language into a binary language that can be recognized by a computer. The destination code may be a binary code that can be recognized by a computer. For example, the executing agent changes the source code into a binary language recognizable by the computer by searching a configuration script when the source code is configured.
Step 303, encapsulating and packaging the target code and the running environment information of the source code set during the development of the source code to obtain a data packet.
In some embodiments, the execution subject encapsulates and packages the target code and the running environment information of the source code set at the time of development of the source code to obtain a data packet. Here, the runtime environment information generally includes operating system information and runtime environment information required by the source code at runtime. The encapsulating and packaging usually maps the target code and the operating environment information into a payload of an encapsulating protocol, and then fills a header of the corresponding protocol to form a data packet of the encapsulating protocol.
Step 304, generate an index for the data packet.
In some embodiments, the execution body may map the data packet to obtain an index corresponding to the data packet. The index may be a primary key added to the packet by the execution entity. For example, the primary key may be an 8-bit binary number.
Step 305, generating a mirror image based on the data packet and the index.
In some embodiments, the executing entity may combine the data packet obtained in step 303 and the index of the data packet obtained in step 304 to obtain a mirror image corresponding to the source code.
And 204, constructing an application running environment based on the mirror image, running the source code, and controlling a display device in communication connection to display running related information of the source code.
In some embodiments, the execution subject may decapsulate the data packet in the image to obtain information required by the application to run. And constructing the running environment of the application by using the information. And operating the source code, and controlling a display device connected with the communication to display the operation related information of the source code. The operation-related information typically includes an output result of the source code. For example, the output of the source code is "big family! ", the operation-related information may be" big family good! ".
In some optional implementations of some embodiments, the method further comprises: analyzing and extracting keywords from the operation related information, wherein the operation related information further comprises information used for representing the operation condition of the application and the operation content of the application; for example, "Java program, run successfully". The analyzing and extracting the keywords is to analyze words of the information for representing the operation condition in the operation related information, and extract the words as keywords, for example, "success". Controlling the terminal equipment running the application to display a prompt box containing the keyword; as an example, the execution body may control a terminal device of the application to display a prompt box containing the keyword, where the terminal device may be a computer or a mobile phone. The prompt box may be a rectangular box containing the prompt information. Controlling the prompt box to be hidden in response to that no user operation aiming at the prompt box is detected within a predefined time period; the predefined time period may be a preset time, for example, 10 seconds. The user operation may be a click operation of the user on the prompt box. Responding to the detection of user operation aiming at the prompt box in a predefined time period, sending the running related information to the terminal equipment of the application, and displaying the running related information on a display of the terminal equipment; as an example, the execution main body may control the terminal device to display the received operation-related information on a display. And storing the operation related information into a storage device of the terminal equipment in a text form. The storage device may be a hard disk or a memory of the terminal device. The execution main body may store the operation-related information in a memory of the terminal device. Here, the running related information is displayed on a display, so that a user can conveniently view the running result of the application. The operation related information is stored in the storage device of the terminal equipment in a text form, so that the storage data of the operation related information is enriched, and the user can further conveniently search the information.
Some embodiments of the present disclosure disclose a method for displaying application information, which enables the execution subject to automatically distinguish a programming language of the source code, and then increase a speed of building the running environment of the source code by obtaining a mirror image corresponding to the programming language from a mirror image repository.
With continued reference to fig. 4, fig. 4 is a flow 400 of further embodiments of methods for displaying application information according to the present disclosure. The method for displaying application information comprises the following steps:
step 401, a configuration script corresponding to each programming language in at least one programming language is constructed.
In some embodiments, the execution subject may build a corresponding configuration script for each of the at least one programming language. The configuration script is automatically searched by the source code during configuration. As an example, the execution body may build a corresponding configuration script for each programming language in advance. For example, a configuration script corresponding to C language, a configuration script corresponding to Java, a configuration script corresponding to Perl language, and a configuration script corresponding to Python.
Step 402, in response to detecting a target operation for an application, obtaining a source code of the application.
In step 403, the programming language of the source code is determined.
At step 404, a mirror image corresponding to the programming language is obtained from the mirror image repository.
Step 405, building an application running environment based on the mirror image, running the source code, and controlling a display device in communication connection to display running related information of the source code.
In some embodiments, the specific implementation and technical effects of steps 402 and 405 may refer to steps 201 and 204 in the embodiments corresponding to fig. 2, which are not described herein again.
Some embodiments of the present disclosure disclose a method for displaying application information, which implements that a configuration script of each programming language is constructed in a configuration process before constructing a mirror image, thereby increasing the speed of creating the mirror image, and reducing resources wasted in constructing the mirror image.
With further reference to fig. 5, as an implementation of the methods illustrated in the above figures, the present disclosure provides some embodiments of an apparatus for displaying application information, which correspond to those method embodiments illustrated in fig. 2, which may be particularly applicable in various electronic devices.
As shown in fig. 5, an apparatus 500 for displaying application information of some embodiments includes: a first acquisition unit 501, a determination unit 502, a second acquisition unit 503, and a display unit 504. The first obtaining unit 501 is configured to, in response to detecting a target operation for an application, obtain a source code of the application; a determining unit 502 configured to determine a programming language of the source code; a second obtaining unit 503 configured to obtain an image corresponding to the programming language from an image repository; a display unit 504 configured to construct an execution environment of the application based on the image, execute the source code, and control a display device of the communication connection to display execution related information of the source code.
In some embodiments, the apparatus 500 for displaying application information further comprises: a construction unit configured to construct a configuration script corresponding to each of the at least one programming language.
In some embodiments, the obtaining step of the mirror in the mirror store in the second obtaining unit 503 is further configured to: selecting the corresponding configuration script according to the programming language; compiling the source code based on the configuration script to generate a target code; packaging and packaging the target code and the running environment information of the source code set during the development of the source code to obtain a data packet; generating an index for the data packet; and generating a mirror image based on the data packet and the index.
In some embodiments, the mirror image warehouse in the second obtaining unit 503 includes any one of the following items: private image library, public image library.
In some embodiments, the determining unit 502 includes: a first determining subunit configured to determine whether a keyword corresponding to a target language is included in the source code; and a second determining subunit configured to determine the programming language of the source code as the target language in response to a determination of yes.
In some embodiments, the determining unit 502 is further configured to: and determining the programming language of the source code according to codes contained in codes of the preset line of the source code.
In some embodiments, the means for displaying application information 500 is further configured to: analyzing and extracting keywords from the operation related information, wherein the operation related information further comprises information used for representing the operation condition of the application and the operation content of the application; controlling the terminal equipment running the application to display a prompt box containing the keyword; controlling the prompt box to be hidden in response to that no user operation aiming at the prompt box is detected within a predefined time period; responding to the detection of user operation aiming at the prompt box in a predefined time period, sending the running related information to the terminal equipment of the application, and displaying the running related information on a display of the terminal equipment; and storing the operation related information into a storage device of the terminal equipment in a text form.
Some embodiments of the present disclosure disclose an apparatus for displaying application information, which enables the execution entity to automatically distinguish a programming language of the source code, and then increase a speed of building the running environment of the source code by obtaining a mirror image corresponding to the programming language from a mirror image repository.
Referring now to FIG. 6, a block diagram of an electronic device (e.g., the server of FIG. 1) 600 suitable for use in implementing some embodiments of the present disclosure is shown. The server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to detecting a target operation aiming at an application, acquiring a source code of the application; determining a programming language of the source code; acquiring a mirror image corresponding to the programming language from a mirror image warehouse; and constructing an application running environment based on the mirror image, running the source code, and controlling a display device in communication connection to display running related information of the source code.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a first acquisition unit, a determination unit, a second acquisition unit, and a display unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, for example, the first obtaining unit may also be described as a "unit that obtains the source code of an application in response to detecting a target operation for the application".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.