CN112256326B - Information processing method, device, equipment and storage medium - Google Patents

Information processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112256326B
CN112256326B CN202011162828.9A CN202011162828A CN112256326B CN 112256326 B CN112256326 B CN 112256326B CN 202011162828 A CN202011162828 A CN 202011162828A CN 112256326 B CN112256326 B CN 112256326B
Authority
CN
China
Prior art keywords
information
extraction function
information extraction
environment variable
target information
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
CN202011162828.9A
Other languages
Chinese (zh)
Other versions
CN112256326A (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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202011162828.9A priority Critical patent/CN112256326B/en
Publication of CN112256326A publication Critical patent/CN112256326A/en
Application granted granted Critical
Publication of CN112256326B publication Critical patent/CN112256326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/74Reverse engineering; Extracting design information from source code
    • 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

Abstract

The embodiment of the disclosure discloses a method, a device, equipment and a storage medium for processing information. Comprising the following steps: configuring an information extraction function body of a construction task, and injecting the information extraction function body into the construction task; acquiring environment variable information of the construction task; adding a context code for the information extraction function body according to the environment variable information to obtain a target information extraction function; and the operation library operates the target information extraction function to obtain target information in the environment variable information. According to the information processing method disclosed by the embodiment of the disclosure, the target information in the construction task is obtained by running the target information extraction function, and the task construction information can be extracted in a self-defined manner so as to realize unified management of information contained in environment variables of the construction task.

Description

Information processing method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a method, a device, equipment and a storage medium for processing information.
Background
If the construction task (such as the Jenkins task) is started by a Hooks mechanism, the starting process is as follows: after the developer submits the code, a Patcheset created event is triggered through the Git warehouse, and then the developer is notified to Jenkins to run the corresponding construction task. When the construction task runs, a plurality of built-in environment variables are provided for the task process, the environment variables can comprise information such as task serial numbers, task links, task names and the like, and the environment variables also carry specific information such as topics submitted by Gits, names of developers, mailboxes and the like.
The build task, when running, typically obtains information in the environment variables for subsequent flows (e.g., notifying a third party system of a state change or additional information). In the related art, all information contained in the environment variable can be obtained each time, but only a few pieces of target information are used in the actual scene, so that it is important to be able to extract the information in the environment variable in a self-defined manner.
Disclosure of Invention
The embodiment of the disclosure provides an information processing method, device, equipment and storage medium, which can extract task construction information in a self-defined manner so as to realize unified management of information contained in environment variables of construction tasks.
In a first aspect, an embodiment of the present disclosure provides a method for processing information, including:
configuring an information extraction function body of a construction task, and injecting the information extraction function body into the construction task;
acquiring environment variable information of the construction task;
adding a context code for the information extraction function body according to the environment variable information to obtain a target information extraction function;
operating the target information extraction function to obtain target information in the environment variable information; wherein the target information is information predefined by the target information extraction function.
In a second aspect, an embodiment of the present disclosure further provides an information processing apparatus, including:
the information extraction function body configuration module is used for configuring an information extraction function body of a construction task and injecting the information extraction function body into the construction task;
the environment variable information acquisition module is used for acquiring environment variable information of the construction task;
the object information extraction function is used for adding a context code to the information extraction function body according to the environment variable information to obtain an object information extraction function;
the target information acquisition module is used for operating the target information extraction function to acquire target information in the environment variable information; wherein the target information is information predefined by the target information extraction function.
In a third aspect, embodiments of the present disclosure further provide an electronic device, including:
one or more processing devices;
a storage means for storing one or more programs;
the one or more programs, when executed by the one or more processing devices, cause the one or more processing devices to implement the information processing method according to the embodiments of the present disclosure.
In a fourth aspect, the embodiments of the present disclosure also disclose a computer readable medium having stored thereon a computer program which, when executed by a processing device, implements a method for processing information according to the embodiments of the present disclosure.
The information processing method, the device, the equipment and the storage medium disclosed by the embodiment of the disclosure comprise the steps of firstly configuring an information extraction function body of a construction task, injecting the information extraction function body into the construction task, then obtaining environment variable information of the construction task, then adding context codes for the information extraction function body according to the environment variable information to obtain a target information extraction function, and finally operating the target information extraction function to obtain target information in the environment variable information. According to the information processing method disclosed by the embodiment of the disclosure, the target information in the construction task is obtained by running the target information extraction function, and the task construction information can be extracted in a self-defined manner so as to realize unified management of information contained in environment variables of the construction task.
Drawings
FIG. 1 is a flow chart of a method of processing information in an embodiment of the present disclosure;
FIG. 2 is an exemplary diagram of injecting information extraction function volumes into build tasks in an embodiment of the present disclosure;
FIG. 3 is a signaling diagram of the processing of one type of information in an embodiment of the present disclosure;
FIG. 4 is a signaling diagram of the processing of one type of information in an embodiment of the present disclosure;
fig. 5 is a schematic structural view of an information processing apparatus in an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the disclosure.
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 have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
In the embodiment of the disclosure, the building task may be a Jenkins task, which is an open-source continuous integration tool for providing friendly operation interfaces, and is mainly used for continuously and automatically building/testing software items and monitoring the operation of external tasks. And task (Job) is an execution plan of Jenkins, which is a collection of a series of operations. After the Jenkins service is ready, we can create a specific Jenkins Task through the "New Item" of the Web service interface. In the embodiment of the present disclosure, the task of the pipeline type (hereinafter, simply referred to as Jenkins Pipeline Task) is mainly aimed at
Wherein Jenkins Pipeline Task may be defined using the Groovy syntax. Specific actions defined by Jenkins Pipeline Task include: designating a Slave node machine for specifically executing a task through a label; defining a custom environment variable of the Task operation; defining different execution phases; the shell script or python script is run using a simple built-in sh instruction.
The goals of Jenkins Job operation are diverse, such as: executing a compiling task to generate a compiled product; and executing deployment tasks and deploying certain services. In the embodiments of the present disclosure, attention is mainly paid to performing compiling tasks.
Jenkins Job, when started, will pass many environment variables for each Job process so that the currently running task knows the environment it is in when running the custom script, for example: BUILD_NUMBER The current BUILD NUMBER, suchs "153"; BUILD_ID The current BUILD ID, identical to BUILD _ NUMBER for BUILDs created in 1.597+, but a YYYY-MM-DD_hh-MM-ss timestamp for older BUILDs; BUILD_URL Full URL of this BUILD, like http:// server: port/jenkins/job/foo/15/; JOB_URL Full URL of this JOB like http:// server: port/jenkins/JOB/foo/.
Wherein, BUILD_NUMBER is the queuing NUMBER of the construction task; the BUILD_ID is the ID of the construction task; the BUILD_URL is a Job address specific to the currently running construction task based on Web access; job_url: task specific Task addresses are currently built based on Web access.
Fig. 1 is a flowchart of a method for processing information provided in an embodiment of the present disclosure, where the embodiment may be suitable for a case of extracting target information in a construction task, where the method may be performed by an information processing apparatus, where the apparatus may be composed of hardware and/or software, and may generally be integrated in a device having a processing function of information, where the device may be an electronic device such as a server, a mobile terminal, or a server cluster. As shown in fig. 1, the method specifically comprises the following steps:
step 110, configuring an information extraction function body of the construction task, and injecting the information extraction function body into the construction task.
The information extraction function body can be a function code block written by a native JavaScript code, and the function body can be customized according to actual requirements. In the embodiment of the present disclosure, the form of the information extraction function body may be:
Figure BDA0002744795230000061
as described above, the information extraction function body extracts information in the environment variable of the construction task in the running process through three entries of changeInfo, buildInfo and accountInfo.
The manner of injecting the information extraction function body into the construction task may be: acquiring an environment variable configuration inlet of a construction task; the information extraction function body is added to the environment variable of the construction task through the configuration inlet.
In the embodiment of the disclosure, the information extraction function body is a code block stored in a character string form, and the information extraction function body can be added into environment variables of a construction task through an environment variable configuration inlet provided by a Jenkins Web interface. By way of example, FIG. 2 is an illustration of injecting an information extraction function into a build task, as shown in FIG. 2, by configuring the environment variables of the build task, the information extraction function is injected into the build task under the designation "ISSUE_ID_EXTRACTOR". The benefit of this may be that the information extraction function body may be obtained by means of conventional acquisition of environment variables.
Step 120, obtaining environment variable information of the construction task.
The environment variable information can comprise environment variable information built in a construction task and Git information submitted by a developer. The built-in environment variable information may include: information such as task serial number, task link, task name, etc.; the Git information may include specific information such as a theme, a developer name, a mailbox, etc.
In the embodiment of the disclosure, after a developer submits a code, a "Patcheset created" event is triggered through a Git repository to notify Jenkins to run related construction tasks, and in the construction task running, built-in environment variable information and Git information submitted by the developer can be obtained.
The acquisition mode can be as follows:
1.const GERRIT_CHANGE_SUBJECT:string=process.env.GERRIT_CHANGE_SUBJECT||”;
2.const GERRIT_CHANGE_URL:string=process.env.GERRIT_CHANGE_URL||”;
3. the input of the function body of the/(generator) as the environment variable can be directly taken
4.const ISSUE_ID_EXTRACTOR:string=process.env.ISSUE_ID_EXTRACTOR||”;。
And 130, adding a context code to the information extraction function body according to the environment variable information to obtain a target information extraction function.
In the embodiment of the disclosure, a "context environment" is required for the information extraction function to operate, and therefore, context codes need to be added to the information extraction function. The target information extraction function comprises a context code and an information extraction function body.
Specifically, adding a context code to the information extraction function body according to the environment variable information, and obtaining the target information extraction function may be: adding a context code template to the information extraction function body; and replacing the placeholder variables in the context code templates according to the environment variable information.
Wherein the context module contains a placeholder variable. For example, the context template may be named extrator.tps, the context module having the following contents:
Figure BDA0002744795230000071
Figure BDA0002744795230000081
as in the above document, the extension is "tps" and cannot be run directly, wherein the string in the form $ { gerrit_xxx } is the respective placeholder variable, which is eventually replaced by the actual variable. In order to conveniently obtain each piece of information, the context code templates are aggregated for different types of parameters, and the variable naming is more semantic. In the context code template, except for the ISSUE_ID_EXTRACTOR, the remaining placeholders need to be expanded with a single quotation mark. Because "ISSUE_ID_EXTRACTOR" itself will run as a function, it does not require the addition of a single-quote wrap. Other placeholders are environment variables that are each passed in as a string, and therefore need to be wrapped with a single quotation mark.
In the embodiment of the disclosure, the process of replacing the placeholder variable in the context code template according to the environment variable information may be: reading a context code template based on a set standard function to obtain a placeholder variable; and replacing the placeholder variable with the corresponding actual variable in the environment variable information.
Wherein, the set standard function may be fs.readfilesync. In the embodiment of the disclosure, when the context code template is read, the following operations need to be performed first:
1.const EXTRACTER_PATH:string=path.resolve(__dirname,'sandbox/extracter.tps');
2.const EXTRACTER_TPL:string=fs.readFileSync(EXTRACTER_PATH).toString();。
that is, the location of the context code module needs to be determined first and then read. By way of example, the manner in which placeholder variables are replaced with corresponding actual variables in the environment variable information may be as follows:
Figure BDA0002744795230000091
Figure BDA0002744795230000101
as can be seen from the above codes, the information extraction function is finally called by the issue_id_extaction (changeInfo, buildInfo, accountinginfo) statement. changeInfo, buildInfo, accountInfo are three variables defined in the context code template, and each usable environment variable in the three variables is classified and aggregated, so that a Jenkins Task manager can directly access the variables through entering parameters when perfecting generator function logic:
Figure BDA0002744795230000102
as above, we can directly access the variable changeInfo. Subject in the final generator function body. This variable corresponds to a specific environmental variable: process. Env. GERRIT_CHANGE_SUBJECT.
Optionally, before adding the context code to the information extraction function body according to the environment variable information, the method further includes the following steps: call scripts are added for building tasks.
The calling script is used for executing the operation of adding context codes to the information extraction function body according to the environment variable information when the construction task runs to the setting stage.
In the embodiment of the disclosure, to enable the construction task to run to the setting stage and execute a certain logic, a script needs to be configured. Exemplary, the following are examples of call scripts for embodiments of the present disclosure:
Figure BDA0002744795230000103
Figure BDA0002744795230000111
as shown above, the configured call script is to run a build_success.ts script after the construction task is run successfully, so as to execute the operation of adding the context code to the information extraction function body according to the environment variable information.
Optionally, the process of adding a context code to the information extraction function body according to the environment variable information may be: and when the construction task runs to the setting stage, adding a context code for the information extraction function body according to the environment variable information.
Illustratively, fig. 3 is a signaling diagram of the processing of one type of information in an embodiment of the present disclosure. As shown in fig. 3, a task manager configures a function for configuring information of a construction task through environment variables, after the configuration is successful, a static task is started, a task instance is created to run the construction task, when the construction task runs to a setting stage, target information in the construction task is extracted through the configured information extraction function, and a result is returned to the task manager.
And 140, running a target information extraction function to obtain target information in the environment variable information.
The target information is information predefined by a target information extraction function.
Optionally, the manner in which the runtime runs the target information extraction function to obtain the target information in the environment variable information may be: calling a third party operation library and acquiring a construction function associated with the third party operation library; creating a function running environment based on the constructor; and sending the target information extraction function to a function operation environment to operate, and obtaining target information in environment variable information.
The third party runtime library may be implemented by a sadbox mechanism, for example, a Node Sandbox library. The third party runtime supports the following functions: the method can be used for executing non-trusted codes, supporting the expiration of the execution time, supporting memory error alarm, supporting graceful error processing, supporting strict mode and the like. The function execution environment may be a sandbox environment. The manner of obtaining the constructor associated with the third party runtime library may be: the associated syntax is introduced using Typescript, for example: import Sandbox from 'sadbox'. The manner in which the function execution environment is created may be: from the official api provided by the sandbox, a node. Js sandbox environment may be created by: const sadbox = new Sandbox ().
Optionally, the process of operating the target information extraction function to obtain the target information in the environment variable information may be: converting the operation result of the target information extraction function into a character string type; and cutting the operation result of the character string type to obtain target information.
The clipping process may be to remove the blank spaces before and after.
In the embodiment of the disclosure, after obtaining the target information in the environment variable information, the return value can be accepted through the callback function, and then the target information received by the callback function is customized.
In the embodiment of the disclosure, after the target information is obtained, the third party system may be notified to perform subsequent operations such as state change or additional information according to the target information.
Illustratively, fig. 4 is a signaling diagram of the processing of one type of information in an embodiment of the present disclosure. As shown in fig. 4, when the build task runs to the set stage, a call script is run, and the context code template is read through the call script; acquiring environment variable information; then, according to the fact that the placeholder variable is replaced by the corresponding actual variable in the environment variable information; storing the generated information extraction function; calling a third party operation library; operating the information extraction function by a third party operation library; and obtaining the extracted target information by the callback function, and returning the result.
According to the technical scheme, firstly, an information extraction function body of a construction task is configured, the information extraction function body is injected into the construction task, then environment variable information of the construction task is obtained, then context codes are added to the information extraction function body according to the environment variable information, a target information extraction function is obtained, and finally, a target information extraction function is operated by an operation library, so that target information in the environment variable information is obtained. According to the information processing method disclosed by the embodiment of the disclosure, the target information in the construction task is obtained by running the target information extraction function, and the task construction information can be extracted in a self-defined manner so as to realize unified management of information contained in environment variables of the construction task.
Fig. 5 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present disclosure, as shown in fig. 5, where the apparatus includes: an information extraction function body configuration module 210, an environment variable information acquisition module 220, a target information extraction function acquisition module 230, and a target information acquisition module 240.
An information extraction function configuration module 210, configured to configure an information extraction function of a construction task, and inject the information extraction function into the construction task;
an environment variable information obtaining module 220, configured to obtain environment variable information of a construction task;
a target information extraction function obtaining module 230, configured to add a context code to the information extraction function body according to the environment variable information, so as to obtain a target information extraction function;
the target information obtaining module 240 is configured to run a target information extraction function by using the runtime library to obtain target information in the environment variable information; wherein the target information is information predefined by the target information extraction function.
Optionally, the information extraction function configuration module 210 is further configured to:
acquiring an environment variable configuration inlet of a construction task;
the information extraction function body is added to the environment variable of the construction task through the configuration inlet.
Optionally, the target information extraction function obtaining module 230 is further configured to:
adding a context code template to the information extraction function body;
and replacing the placeholder variables in the context code templates according to the environment variable information.
Optionally, the target information extraction function obtaining module 230 is further configured to:
reading a context code template based on a set standard function to obtain a placeholder variable;
and replacing the placeholder variable with the corresponding actual variable in the environment variable information.
Optionally, the method further comprises: and calling a script adding module for:
adding a call script for the construction task; the call script is used for executing the operation of adding context codes to the information extraction function body according to the environment variable information when the construction task runs to the setting stage;
optionally, the target information extraction function obtaining module 230 is further configured to:
when the construction task runs to the setting stage, a context code is added to the information extraction function body according to the environment variable information.
Optionally, the target information extraction module 240 is further configured to:
calling a third party operation library and acquiring a construction function associated with the third party operation library;
creating a function running environment based on the constructor;
and sending the target information extraction function to a function operation environment to operate, and obtaining target information in environment variable information.
Optionally, the target information extraction module 240 is further configured to:
converting the operation result of the target information extraction function into a character string type;
and cutting the operation result of the character string type to obtain target information.
The device can execute the method provided by all the embodiments of the disclosure, and has the corresponding functional modules and beneficial effects of executing the method. Technical details not described in detail in this embodiment can be found in the methods provided by all of the foregoing embodiments of the present disclosure.
Referring now to fig. 6, a schematic diagram of an electronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), etc., as well as fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers such as stand-alone servers or server clusters. The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage means 305 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 308 including, for example, magnetic tape, hard disk, etc.; and communication means 309. The communication means 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 300 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program containing program code for performing a recommended method of words. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 309, or installed from storage means 305, or installed from ROM 302. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 the context of this 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 the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, 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 communication 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 networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated 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: configuring an information extraction function body of a construction task, and injecting the information extraction function body into the construction task; acquiring environment variable information of the construction task; adding a context code for the information extraction function body according to the environment variable information to obtain a target information extraction function; and the operation library operates the target information extraction function to obtain target information in the environment variable information.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts 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 involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein 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: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
According to one or more embodiments of the present disclosure, the embodiments of the present disclosure disclose a method for processing information, including:
configuring an information extraction function body of a construction task, and injecting the information extraction function body into the construction task;
acquiring environment variable information of the construction task;
adding a context code for the information extraction function body according to the environment variable information to obtain a target information extraction function;
operating the target information extraction function to obtain target information in the environment variable information; the target information is information predefined by the target information extraction function.
Further, injecting the information extraction function into the build task includes:
acquiring an environment variable configuration inlet of the construction task;
and adding the information extraction function body to the environment variable of the construction task through the configuration inlet.
Further, adding a context code to the information extraction function body according to the environment variable information to obtain a target information extraction function, including:
adding a context code template to the information extraction function body;
and replacing the placeholder variables in the context code template according to the environment variable information.
Further, replacing placeholder variables in the context code template according to the environment variable information comprises:
reading the context code template based on a set standard function to obtain a placeholder variable;
and replacing the placeholder variable with a corresponding actual variable in the environment variable information.
Further, before adding context codes to the information extraction function body according to the environment variable information, the method further comprises:
adding a call script for the construction task; the call script is used for executing the operation of adding context codes to the information extraction function body according to the environment variable information when the construction task runs to a setting stage;
correspondingly, adding a context code for the information extraction function body according to the environment variable information comprises the following steps:
and when the construction task runs to the setting stage, adding context codes to the information extraction function body according to the environment variable information.
Further, invoking a third party runtime to run the target information extraction function to extract target information in the environment variable information, including:
calling a third party operation library and acquiring a construction function associated with the third party operation library;
creating a function running environment based on the constructor;
and sending the target information extraction function to the function operation environment to operate, and obtaining the target information in the environment variable information.
Further, running the target information extraction function to obtain target information in the environment variable information, including:
converting the operation result of the target information extraction function into a character string type;
and cutting the operation result of the character string type to obtain target information.
Note that the above is only a preferred embodiment of the present disclosure and the technical principle applied. Those skilled in the art will appreciate that the present disclosure is not limited to the specific embodiments described herein, and that various obvious changes, rearrangements and substitutions can be made by those skilled in the art without departing from the scope of the disclosure. Therefore, while the present disclosure has been described in connection with the above embodiments, the present disclosure is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.

Claims (8)

1. A method of processing information, comprising:
configuring an information extraction function body of a construction task, and injecting the information extraction function body into the construction task;
acquiring environment variable information of the construction task;
adding a context code for the information extraction function body according to the environment variable information to obtain a target information extraction function;
operating the target information extraction function to obtain target information in the environment variable information; wherein the target information is information predefined by the target information extraction function;
the operating the target information extraction function to obtain target information in the environment variable information includes:
calling a third-party operation library and acquiring a construction function associated with the third-party operation library;
creating a function running environment based on the constructor;
the target information extraction function is sent to the function operation environment to operate, and the target information in the environment variable information is obtained, or
Converting the operation result of the target information extraction function into a character string type;
and cutting the operation result of the character string type to obtain target information.
2. The method of claim 1, wherein injecting the information extraction function body into the build task comprises:
acquiring an environment variable configuration inlet of the construction task;
and adding the information extraction function body to the environment variable of the construction task through the configuration inlet.
3. The method according to claim 1, wherein adding a context code to the information extraction function body according to the environment variable information to obtain a target information extraction function, comprises:
adding a context code template to the information extraction function body;
and replacing the placeholder variables in the context code template according to the environment variable information.
4. A method according to claim 3, wherein replacing placeholder variables in the context code template according to the environment variable information comprises:
reading the context code template based on a set standard function to obtain a placeholder variable;
and replacing the placeholder variable with a corresponding actual variable in the environment variable information.
5. The method of claim 1, further comprising, prior to adding context code to the information extraction function body based on the environment variable information:
adding a call script for the construction task; the call script is used for executing the operation of adding context codes to the information extraction function body according to the environment variable information when the construction task runs to a setting stage;
correspondingly, adding a context code for the information extraction function body according to the environment variable information comprises the following steps:
and when the construction task runs to the setting stage, adding a context code for the information extraction function body according to the environment variable information.
6. An information processing apparatus, comprising:
the information extraction function body configuration module is used for configuring an information extraction function body of a construction task and injecting the information extraction function body into the construction task;
the environment variable information acquisition module is used for acquiring environment variable information of the construction task;
the target information extraction function acquisition module is used for adding a context code to the information extraction function body according to the environment variable information to obtain a target information extraction function;
the target information acquisition module is used for operating the target information extraction function to acquire target information in the environment variable information; wherein the target information is information predefined by the target information extraction function;
the target information acquisition module is also used for calling a third-party operation library and acquiring a construction function associated with the third-party operation library;
creating a function running environment based on the constructor;
the target information extraction function is sent to the function operation environment to operate, and the target information in the environment variable information is obtained, or
Converting the operation result of the target information extraction function into a character string type;
and cutting the operation result of the character string type to obtain target information.
7. An electronic device, the electronic device comprising:
one or more processing devices;
a storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the method of processing information as claimed in any of claims 1-5.
8. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processing device, implements the method of processing information according to any one of claims 1-5.
CN202011162828.9A 2020-10-27 2020-10-27 Information processing method, device, equipment and storage medium Active CN112256326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011162828.9A CN112256326B (en) 2020-10-27 2020-10-27 Information processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011162828.9A CN112256326B (en) 2020-10-27 2020-10-27 Information processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112256326A CN112256326A (en) 2021-01-22
CN112256326B true CN112256326B (en) 2023-07-07

Family

ID=74262069

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011162828.9A Active CN112256326B (en) 2020-10-27 2020-10-27 Information processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112256326B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103635885A (en) * 2011-06-28 2014-03-12 微软公司 Deploying environments for testing by providing instantaneous availability of prebuilt environments
CN110515625A (en) * 2019-08-02 2019-11-29 苏州浪潮智能科技有限公司 Task construction method, device, equipment and computer readable storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9116766B2 (en) * 2013-07-31 2015-08-25 Sap Se Extensible applications using a mobile application framework
US20150234796A1 (en) * 2014-02-18 2015-08-20 Mobile Oxygen Llc Creating, managing, and distributing dynamic content to smartphones
CN110058863A (en) * 2019-03-16 2019-07-26 平安城市建设科技(深圳)有限公司 Construction method, device, equipment and the storage medium of Docker container
CN110851211A (en) * 2019-11-13 2020-02-28 北京云途腾科技有限责任公司 Method, apparatus, electronic device, and medium for displaying application information
CN111221572B (en) * 2020-01-13 2023-09-01 北京字节跳动网络技术有限公司 Method, device, medium and equipment for automatically adapting to running environment
CN111309304B (en) * 2020-02-11 2023-07-11 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating IDL file
CN111767058A (en) * 2020-06-30 2020-10-13 上海商汤智能科技有限公司 Program compiling method and device, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103635885A (en) * 2011-06-28 2014-03-12 微软公司 Deploying environments for testing by providing instantaneous availability of prebuilt environments
CN110515625A (en) * 2019-08-02 2019-11-29 苏州浪潮智能科技有限公司 Task construction method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN112256326A (en) 2021-01-22

Similar Documents

Publication Publication Date Title
US10990367B2 (en) Application development method, tool, and device, and storage medium
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
US11667033B2 (en) Systems and methods for robotic process automation
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
US9201637B1 (en) Managing generic objects across multiple runtime environments
CN109408136A (en) Information processing method, device, storage medium and electronic equipment
CN110543297A (en) method and apparatus for generating source code
WO2018090871A1 (en) Application service indication method and application service indication device
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN111158750B (en) Packing method and device of game installation package based on Unity
CN110851211A (en) Method, apparatus, electronic device, and medium for displaying application information
US9996344B2 (en) Customized runtime environment
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN110489162A (en) Installation kit SO file compressing method, device, medium and equipment
CN112596854A (en) Method and device for continuously integrating running of assembly line
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN110704050B (en) Module initializing method and device, electronic equipment and computer readable storage medium
CN112256326B (en) Information processing method, device, equipment and storage medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN112835568A (en) Project construction method and device
CN111309323B (en) Parameter initialization method and device and electronic equipment
CN113761588A (en) Data verification method and device, terminal equipment and storage medium
CN112099841A (en) Method and system for generating configuration file
CN111488286A (en) Method and device for independently developing Android module
CN112068814A (en) Method, device, system and medium for generating executable file

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