Movatterモバイル変換


[0]ホーム

URL:


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

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

Info

Publication number
CN112256326A
CN112256326ACN202011162828.9ACN202011162828ACN112256326ACN 112256326 ACN112256326 ACN 112256326ACN 202011162828 ACN202011162828 ACN 202011162828ACN 112256326 ACN112256326 ACN 112256326A
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.)
Granted
Application number
CN202011162828.9A
Other languages
Chinese (zh)
Other versions
CN112256326B (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 LtdfiledCriticalBeijing Zitiao Network Technology Co Ltd
Priority to CN202011162828.9ApriorityCriticalpatent/CN112256326B/en
Publication of CN112256326ApublicationCriticalpatent/CN112256326A/en
Application grantedgrantedCritical
Publication of CN112256326BpublicationCriticalpatent/CN112256326B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本公开实施例公开了一种信息的处理方法、装置、设备及存储介质。包括:配置构建任务的信息提取函数体,并将所述信息提取函数体注入所述构建任务中;获取所述构建任务的环境变量信息;根据所述环境变量信息为所述信息提取函数体添加上下文代码,获得目标信息提取函数;运行库运行所述目标信息提取函数,获得所述环境变量信息中的目标信息。本公开实施例公开的信息的处理方法,通过运行目标信息提取函数,获得构建任务中的目标信息,可以自定义的提取任务构建信息,以实现对构建任务的环境变量包含的信息的统一管理。

Figure 202011162828

The embodiments of the present disclosure disclose an information processing method, apparatus, device, and storage medium. It includes: configuring the information extraction function body of the construction task, and injecting the information extraction function body into the construction task; acquiring the environment variable information of the construction task; adding the information extraction function body according to the environment variable information The context code obtains the target information extraction function; the runtime library runs the target information extraction function to obtain the target information in the environment variable information. The information processing method disclosed in the embodiment of the present disclosure obtains the target information in the construction task by running the target information extraction function, and can customize the extraction task construction information to realize unified management of the information contained in the environment variables of the construction task.

Figure 202011162828

Description

Information processing method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, and in particular, to an information processing method, an information processing device, information processing equipment and a storage medium.
Background
If the construction task (such as Jenkins task) is started through a Hooks mechanism, the starting process is as follows: after the developer submits the code, a Patchset created event is triggered through a Git warehouse, and then Jenkins is informed to run a corresponding construction task. When the constructed task runs, a plurality of built-in environment variables are provided for a task process, the environment variables can comprise information such as task sequence numbers, task links and task names, and the environment variables can also carry specific information such as topics submitted by Git, developer names and mailboxes.
The build task, when running, typically obtains information in the environment variables for subsequent processes (e.g., notifying a third-party system of a state change or appending additional information). In the related art, all information contained in the environment variable is acquired each time, and only a few target information is used in an actual scene, so that it is very important to be able to extract information in the environment variable in a customized manner.
Disclosure of Invention
The embodiment of the disclosure provides an information processing method, an information processing device, information processing equipment and a storage medium, which can extract task construction information in a user-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 an information processing method, 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 context codes to the information extraction function body according to the environment variable information to obtain a target information extraction function;
running 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 apparatus for processing information, 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 the environment variable information of the construction task;
the target information extraction function is used for adding context codes 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.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes:
one or more processing devices;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing apparatuses, the one or more processing apparatuses are caused to implement the information processing method according to the embodiment of the present disclosure.
In a fourth aspect, the disclosed embodiments also disclose a computer-readable medium, on which a computer program is stored, which when executed by a processing device, implements a method for processing information as described in the disclosed embodiments.
The information processing method, the information processing device, the information processing equipment and the information processing storage medium disclosed by the embodiment of the disclosure are characterized in that an information extraction function body of a construction task is configured firstly, the information extraction function body is injected into the construction task, then environment variable information of the construction task is obtained, 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 the target information extraction function is operated 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 operating the target information extraction function, and the task construction information can be extracted in a user-defined manner, so that the unified management of the information contained in the environment variable of the construction task is realized.
Drawings
FIG. 1 is a flow chart of a method of processing information in an embodiment of the disclosure;
FIG. 2 is an exemplary diagram of injecting a body of information extraction functions into a build task in an embodiment of the disclosure;
FIG. 3 is a signaling diagram of the processing of one type of information in an embodiment of the disclosure;
FIG. 4 is a signaling diagram of the processing of one type of information in an embodiment of the disclosure;
fig. 5 is a schematic structural diagram 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 present 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 are shown in the 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 rather 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 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. Moreover, 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 "include" and variations thereof as used herein are 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". Relevant definitions for other terms will be given in the following description.
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.
In the embodiment of the disclosure, the construction task may be a Jenkins task, which is an open-source continuous integration tool providing a friendly operation interface, and is mainly used for continuously and automatically constructing/testing a software project and monitoring the operation of an external task. And task (Job) is an execution plan for Jenkins, which is a collection of operations. After the Jenkins service is ready, we can create a specific Jenkins Task through the "New Item" of the Web services interface. In the embodiment of the disclosure, the Task mainly aims at the Pipeline type (hereinafter, referred to as Jenkins Pipeline Task)
Wherein Jenkins Pipeline Task can be defined by using Groovy syntax. Specific behaviors defined by Jenkins Pipeline Task include: a Slave node machine for specifically executing tasks is specified through label; defining a self-defined environment variable of the Task runtime; defining different execution phases; a simple built-in sh instruction is used to run a shell script or a python script.
The goals for Jenkins Job operations are diverse, for example: executing the compiling task to generate a compiled product; and executing a deployment task and deploying certain services. In the embodiment of the disclosure, the execution of the compiling task is mainly focused.
When the Jenkins Job is started, a plurality of environment variables can be transmitted to each Job process, so that the currently running task can know the environment of the task when running the custom script, for example: BUILD _ NUMBER, The current built NUMBER, sucas "153"; BUILD _ ID, namely The current BUILD ID, identification to BUILD _ NUMBER for BUILD created in 1.597+, but a YYYY-MM-DD _ hh-MM-ss timemap for stacks; BUILD _ URL, Full URL of this BUILD, like http:// server, port/jenkins/job/foo/15/; JOB _ URL, Full URL of this jobi, like http:// server: port/jenkins/jobo/.
Wherein, BUILD _ NUMBER is a queuing NUMBER of a construction task; BUILD _ ID is the ID of the construction task; BUILD _ URL is a specific Job address of a currently running construction task based on Web access; JOB _ URL: based on Web access, a Task specific Task address is currently constructed.
Fig. 1 is a flowchart of an information processing method provided in an embodiment of the present disclosure, where this embodiment is applicable to a case of extracting target information in a construction task, and the method may be executed by an information processing apparatus, where the apparatus may be composed of hardware and/or software, and may be generally integrated in a device having an information processing function, 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:
and 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 mentioned above, the information extraction function body extracts the information in the environment variable of the construction task in the running process through three entries of changeInfo, buildInfo and accountInfo.
The method for injecting the information extraction function body into the construction task may be as follows: acquiring an environment variable configuration inlet of a construction task; and adding the information extraction function body to the environment variable of the construction task through the configuration entrance.
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 to the environment variable of the construction task through an environment variable configuration entry provided by a Jenkins Web interface. Illustratively, fig. 2 is an exemplary diagram of injecting an information extraction function body into a construction task, as shown in fig. 2, the information extraction function body is injected into the construction task by configuring an environment variable of the construction task, and is named as "isue _ ID _ extactor". The advantage of this may be that the information extraction function body may be obtained by conventional means of obtaining environment variables.
And step 120, acquiring environment variable information of the construction task.
The environment variable information may include environment variable information built in the construction task and Git information submitted by the developer. The built-in environment variable information may include: information such as task sequence number, task link, task name, etc.; the Git information may include specific information such as a topic, a developer name, a mailbox, and the like.
In the embodiment of the disclosure, after the developer submits the code, a patch created event is triggered through a Git warehouse to notify Jenkins to run related construction tasks, and in the construction task running, the built-in environment variable information and Git information submitted by the developer can be acquired.
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 function body of the/generator is transferred as an environment variable and can be directly taken
4.const ISSUE_ID_EXTRACTOR:string=process.env.ISSUE_ID_EXTRACTOR||”;。
And step 130, adding context codes to the information extraction function body according to the environment variable information to obtain a target information extraction function.
In the embodiment of the present disclosure, a "context environment" is required to make the information extraction function run, and therefore, context code needs to be added to the information extraction function. The target information extraction function comprises a context code and an information extraction function body.
Specifically, the method for obtaining the target information extraction function by adding the context code to the information extraction function according to the environment variable information may be: 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.
Wherein, the context module comprises a placeholder variable. Illustratively, the context template may be named extra.tps, and the contents of the context module are as follows:
Figure BDA0002744795230000071
Figure BDA0002744795230000081
as with the above file, the extension is "tps" and cannot be run directly, where $ { GERRIT _ XXX } form of the string is the respective placeholder variable and will eventually be replaced by the actual variable. In addition, in order to conveniently obtain each piece of information, the context code template is aggregated aiming at different types of parameters, and the variable naming is more semantic. In the context code template, except for "ISSUE _ ID _ EXTRACTOR", the rest of placeholders need to be expanded by using a single quotation mark. Since "ISSUE _ ID _ EXTRACTOR" itself is going to run as a function, it does not need to be wrapped with a single quotation mark. While the other placeholders are each environment variables passed in as strings and therefore need to be wrapped with a single quotation mark.
In this embodiment of the present 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 a corresponding actual variable in the environment variable information.
Wherein, the set standard function may be fs. In the embodiment of the present disclosure, when reading the context code template, 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();。
namely, the position of the context code module needs to be determined first, and then reading is performed. For example, the manner of replacing the placeholder variable with the corresponding actual variable in the environment variable information can be as follows:
Figure BDA0002744795230000091
Figure BDA0002744795230000101
as can be seen from the above codes, the information extraction function is finally called by an ISSUE _ ID _ exit (changeInfo, buildInfo, accountInfo) statement. changeInfo, buildInfo, accountInfo are three variables defined in the context code template, and the three variables are classified and aggregated for each usable environment variable, so that Jenkins Task administrator can directly access the variables through entries when perfecting the logic of the generator function:
Figure BDA0002744795230000102
as with the above code, we have direct access to the changeinfo. This variable corresponds to a specific environment variable as: process, env, gerrit _ CHANGE _ reject.
Optionally, before adding the context code to the information extraction function according to the environment variable information, the method further includes the following steps: and adding a calling script for the construction task.
And the calling script is used for executing the operation of adding the context code 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 present disclosure, in order to make the construction task run to the setting stage and execute a certain logic, a script needs to be configured. Illustratively, the following is an example of a calling script of an embodiment of the present disclosure:
Figure BDA0002744795230000103
Figure BDA0002744795230000111
as shown above, the configured calling script is a built _ success.ts script that is run after the build task is run successfully, so as to execute the operation of adding context codes to the information extraction function according to the environment variable information.
Optionally, adding a context code to the information extraction function according to the environment variable information may be performed by: 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.
Illustratively, fig. 3 is a signaling diagram of a process of information in an embodiment of the disclosure. As shown in fig. 3, a task administrator configures an information extraction function for a construction task through an environment variable, starts a static task after successful configuration, runs the construction task by creating a task instance, extracts target information in the construction task by running the configured information extraction function when the construction task runs to a setting stage, and returns a result to the task administrator.
And 140, operating 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 runtime runs the target information extraction function, and the manner of obtaining 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 operating environment based on the constructor; and sending the target information extraction function to a function operation environment for operation, and obtaining the target information in the environment variable information.
The third-party runtime library may be implemented by a Sandbox mechanism, for example, a Node Sandbox library. The third party runtime supports the following functions: the method can be used for executing untrusted codes, supporting the ultra-long expiration of execution duration, supporting memory error alarm, supporting elegant error processing, supporting strict modes and the like. The function runtime environment may be a sandbox environment. The manner of obtaining the constructor associated with the third-party runtime library may be: and adopting the grammar of the import association of the Typescript, for example: import Sandbox from 'Sandbox'. The way of creating the function runtime environment may be: a node. Const Sandbox ═ 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 running result of the character string type to obtain target information.
The cutting process may be to remove a space before and after the cutting.
In the embodiment of the disclosure, after the target information in the environment variable information is obtained, the return value can be received 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, a third-party system may be notified to perform subsequent operations such as state change or additional information addition according to the target information.
Illustratively, fig. 4 is a signaling diagram of a process of information in an embodiment of the disclosure. As shown in fig. 4, when the build task runs to the setting stage, a call script is run, and the context code template is read through the call script; acquiring environment variable information; then replacing the placeholder variable with a corresponding actual variable in the environment variable information; storing the generated information extraction function; calling a third-party operation library; running an information extraction function by a third-party running library; and obtaining the extracted target information by the callback function, and returning the result.
According to the technical scheme of the embodiment of the invention, an information extraction function body of a construction task is configured firstly, the information extraction function body is injected into the construction task, then environment variable information of the construction task is obtained, context codes are added to the information extraction function body according to the environment variable information to obtain a target information extraction function, and finally a running base runs 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 operating the target information extraction function, and the task construction information can be extracted in a user-defined manner, so that the unified management of the information contained in the environment variable of the construction task is realized.
Fig. 5 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present disclosure, and as shown in fig. 5, the apparatus includes: an information extraction functionbody configuration module 210, an environment variableinformation acquisition module 220, a target information extractionfunction acquisition module 230, and a targetinformation acquisition module 240.
The information extraction functionbody configuration module 210 is configured to configure an information extraction function body of the construction task, and inject the information extraction function body into the construction task;
an environment variableinformation obtaining module 220, configured to obtain environment variable information of a construction task;
a target information extractionfunction obtaining module 230, configured to add a context code to the information extraction function according to the environment variable information, so as to obtain a target information extraction function;
a targetinformation obtaining module 240, configured to run a target information extraction function in 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 functionbody configuration module 210 is further configured to:
acquiring an environment variable configuration inlet of a construction task;
and adding the information extraction function body to the environment variable of the construction task through the configuration entrance.
Optionally, the target information extractingfunction 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 template according to the environment variable information.
Optionally, the target information extractingfunction 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 a corresponding actual variable in the environment variable information.
Optionally, the method further includes: a call script adding module for:
adding a calling script for a construction task; 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;
optionally, the target information extractingfunction obtaining module 230 is further configured to:
and when the construction task runs to a setting stage, adding context codes to the information extraction function body according to the environment variable information.
Optionally, the targetinformation extracting 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 operating environment based on the constructor;
and sending the target information extraction function to a function operation environment for operation, and obtaining the target information in the environment variable information.
Optionally, the targetinformation extracting module 240 is further configured to:
converting the operation result of the target information extraction function into a character string type;
and cutting the running result of the character string type to obtain target information.
The device can execute the methods provided by all the embodiments of the disclosure, and has corresponding functional modules and beneficial effects for executing the methods. For technical details that are not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the disclosure.
Referring now to FIG. 6, a block diagram of anelectronic device 300 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like, or various forms of servers such as a stand-alone server or a server cluster. The electronic device 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 300 may include a processing means (e.g., central processing unit, graphics processor, etc.) 301 that may perform various appropriate actions and processes in accordance with a program stored in a read-only memory device (ROM)302 or a program loaded from astorage device 305 into a random access memory device (RAM) 303. In theRAM 303, various programs and data necessary for the operation of theelectronic apparatus 300 are also stored. Theprocessing device 301, theROM 302, and theRAM 303 are connected to each other via abus 304. An input/output (I/O)interface 305 is also connected tobus 304.
Generally, the following devices may be connected to the I/O interface 305:input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; anoutput device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like;storage devices 308 including, for example, magnetic tape, hard disk, etc.; and acommunication device 309. The communication means 309 may allow theelectronic device 300 to communicate wirelessly or by wire with other devices to exchange data. While fig. 6 illustrates anelectronic device 300 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.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the 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 method for recommending words. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 305, or installed from theROM 302. The computer program, when executed by theprocessing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can 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 the present 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 contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either 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 interconnect 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: 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 context codes to the information extraction function body according to the environment variable information to obtain a target information extraction function; and the running library runs the target information extraction function to obtain the target information in the environment variable information.
Computer program code for carrying out operations for the present disclosure may be written in any combination of 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 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 the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
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.
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. A 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 disclosed embodiments, the disclosed embodiments disclose an information processing method, 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 context codes to the information extraction function body according to the environment variable information to obtain a target information extraction function;
running 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 body into the construction 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 entrance.
Further, adding a context code to the information extraction function 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 variable in the context code template according to the environment variable information.
Further, replacing the placeholder variable in the context code template according to the environment variable information includes:
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 code to the information extraction function according to the environment variable information, the method further includes:
adding a calling script for the construction task; 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 a set stage;
correspondingly, adding a context code to the information extraction function body according to the environment variable information includes:
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, calling a third-party runtime library to run the target information extraction function to extract the 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 runtime environment based on the constructor;
and sending the target information extraction function to the function operation environment for operation, and obtaining the target information in the environment variable information.
Further, the running the target information extraction function to obtain the target information in the environment variable information includes:
converting the operation result of the target information extraction function into a character string type;
and cutting the running result of the character string type to obtain target information.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the particular embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include 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 (10)

Translated fromChinese
1.一种信息的处理方法,其特征在于,包括:1. a processing method of information, is characterized in that, comprises:配置构建任务的信息提取函数体,并将所述信息提取函数体注入所述构建任务中;Configuring the information extraction function body of the construction task, and injecting the information extraction function body into the construction task;获取所述构建任务的环境变量信息;Obtain the environment variable information of the build task;根据所述环境变量信息为所述信息提取函数体添加上下文代码,获得目标信息提取函数;Add context code to the information extraction function body according to the environment variable information to obtain the target information extraction function;运行所述目标信息提取函数,获得所述环境变量信息中的目标信息;其中,所述目标信息为所述目标信息提取函数预定义的信息。Run 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.2.根据权利要求1所述的方法,其特征在于,将所述信息提取函数体注入所述构建任务中,包括:2. The method according to claim 1, wherein injecting the information extraction function body into the construction task, comprising:获取所述构建任务的环境变量配置入口;Obtain the environment variable configuration entry of the build task;通过所述配置入口将所述信息提取函数体添加至所述构建任务的环境变量中。The information extraction function body is added to the environment variable of the construction task through the configuration entry.3.根据权利要求1所述的方法,其特征在于,根据所述环境变量信息为所述信息提取函数体添加上下文代码,获得目标信息提取函数,包括:3. The method according to claim 1, wherein adding a context code to the information extraction function body according to the environmental variable information to obtain a target information extraction function, comprising:对所述信息提取函数体添加上下文代码模板;adding a context code template to the information extraction function body;根据所述环境变量信息替换所述上下文代码模板中的占位符变量。Placeholder variables in the context code template are replaced according to the environment variable information.4.根据权利要求3所述的方法,其特征在于,根据所述环境变量信息替换所述上下文代码模板中的占位符变量,包括:4. The method according to claim 3, wherein replacing the placeholder variable in the context code template according to the environment variable information, comprising:基于设定标准函数读取所述上下文代码模板,获得占位符变量;Read the context code template based on the set standard function to obtain a placeholder variable;将所述占位符变量替换为所述环境变量信息中对应的实际变量。Replace the placeholder variable with the corresponding actual variable in the environment variable information.5.根据权利要求1所述的方法,其特征在于,在根据所述环境变量信息为所述信息提取函数体添加上下文代码之前,还包括:5. The method according to claim 1, wherein before adding context code to the information extraction function body according to the environment variable information, further comprising:为所述构建任务添加调用脚本;所述调用脚本用于当所述构建任务运行至设定阶段时,执行根据所述环境变量信息为所述信息提取函数体添加上下文代码的操作;adding an invocation script to the construction task; the invocation script is used to perform an operation of adding context code to the information extraction function body according to the environment variable information when the construction task runs to a setting stage;相应的,根据所述环境变量信息为所述信息提取函数体添加上下文代码,包括:Correspondingly, adding context code to the information extraction function body according to the environment variable information, including:当所述构建任务运行至所述设定阶段时,根据所述环境变量信息为所述信息提取函数体添加上下文代码。When the construction task runs to the setting stage, add context code to the information extraction function body according to the environment variable information.6.根据权利要求1所述的方法,其特征在于,运行所述目标信息提取函数,获得所述环境变量信息中的目标信息,包括:6. The method according to claim 1, wherein, running the target information extraction function to obtain target information in the environment variable information, comprising:调用第三方运行库,并获取所述第三方运行库关联的构造函数;calling a third-party runtime library, and obtaining the constructor associated with the third-party runtime library;基于所述构造函数创建函数运行环境;Create a function execution environment based on the constructor;将所述目标信息提取函数发送至所述函数运行环境中运行,获得所述环境变量信息中的目标信息。Sending the target information extraction function to the function execution environment for execution to obtain target information in the environment variable information.7.根据权利要求1所述的方法,其特征在于,运行所述目标信息提取函数,获得所述环境变量信息中的目标信息,包括:7. The method according to claim 1, wherein, running the target information extraction function to obtain target information in the environment variable information, comprising:将所述目标信息提取函数的运行结果转换为字符串类型;Converting the running result of the target information extraction function into a string type;对所述字符串类型的运行结果进行裁剪处理,获得目标信息。The operation result of the character string type is clipped to obtain target information.8.一种信息的处理装置,其特征在于,包括:8. An information processing device, comprising:信息提取函数体配置模块,用于配置构建任务的信息提取函数体,并将所述信息提取函数体注入所述构建任务中;an information extraction function body configuration module, configured to configure the information extraction function body of the construction task, and inject the information extraction function body into the construction task;环境变量信息获取模块,用于获取所述构建任务的环境变量信息;an environment variable information acquisition module for acquiring the environment variable information of the construction task;目标信息提取函数获取模块,用于根据所述环境变量信息为所述信息提取函数体添加上下文代码,获得目标信息提取函数;a target information extraction function acquisition module, configured to add a context code to the information extraction function body according to the environmental variable information to obtain a target information extraction function;目标信息获取模块,用于运行所述目标信息提取函数,获得所述环境变量信息中的目标信息;其中,所述目标信息为所述目标信息提取函数预定义的信息。A target information acquisition module, configured to run 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.9.一种电子设备,其特征在于,所述电子设备包括:9. An electronic device, characterized in that the electronic device comprises:一个或多个处理装置;one or more processing devices;存储装置,用于存储一个或多个程序;a storage device for storing one or more programs;当所述一个或多个程序被所述一个或多个处理装置执行,使得所述一个或多个处理装置实现如权利要求1-7中任一所述的信息的处理方法。When the one or more programs are executed by the one or more processing apparatuses, the one or more processing apparatuses implement the information processing method according to any one of claims 1-7.10.一种计算机可读介质,其上存储有计算机程序,其特征在于,该程序被处理装置执行时实现如权利要求1-7中任一所述的信息的处理方法。10. A computer-readable medium on which a computer program is stored, characterized in that, when the program is executed by a processing device, the information processing method according to any one of claims 1-7 is implemented.
CN202011162828.9A2020-10-272020-10-27 Information processing method, device, equipment and storage mediumActiveCN112256326B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011162828.9ACN112256326B (en)2020-10-272020-10-27 Information processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011162828.9ACN112256326B (en)2020-10-272020-10-27 Information processing method, device, equipment and storage medium

Publications (2)

Publication NumberPublication Date
CN112256326Atrue CN112256326A (en)2021-01-22
CN112256326B CN112256326B (en)2023-07-07

Family

ID=74262069

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011162828.9AActiveCN112256326B (en)2020-10-272020-10-27 Information processing method, device, equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN112256326B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114579107A (en)*2022-03-112022-06-03北京字跳网络技术有限公司Data processing method, device, equipment and medium
CN115705184A (en)*2021-08-062023-02-17中国移动通信有限公司研究院 Data acquisition method, device, electronic device and readable storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103635885A (en)*2011-06-282014-03-12微软公司Deploying environments for testing by providing instantaneous availability of prebuilt environments
US20150040099A1 (en)*2013-07-312015-02-05Sap AgExtensible applications using a mobile application framework
US20150234796A1 (en)*2014-02-182015-08-20Mobile Oxygen LlcCreating, managing, and distributing dynamic content to smartphones
CN110058863A (en)*2019-03-162019-07-26平安城市建设科技(深圳)有限公司Construction method, device, equipment and the storage medium of Docker container
CN110515625A (en)*2019-08-022019-11-29苏州浪潮智能科技有限公司 Task construction method, apparatus, device, and computer-readable storage medium
CN110851211A (en)*2019-11-132020-02-28北京云途腾科技有限责任公司Method, apparatus, electronic device, and medium for displaying application information
CN111221572A (en)*2020-01-132020-06-02北京字节跳动网络技术有限公司Method, device, medium and equipment for automatically adapting to operating environment
CN111309304A (en)*2020-02-112020-06-19北京字节跳动网络技术有限公司Method, device, medium and electronic equipment for generating IDL file
CN111562942A (en)*2020-04-302020-08-21中国银行股份有限公司Gitlab-based mobile APP continuous integration device and method
CN111767058A (en)*2020-06-302020-10-13上海商汤智能科技有限公司 Program compiling method and device, electronic device and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103635885A (en)*2011-06-282014-03-12微软公司Deploying environments for testing by providing instantaneous availability of prebuilt environments
US20150040099A1 (en)*2013-07-312015-02-05Sap AgExtensible applications using a mobile application framework
US20150234796A1 (en)*2014-02-182015-08-20Mobile Oxygen LlcCreating, managing, and distributing dynamic content to smartphones
CN110058863A (en)*2019-03-162019-07-26平安城市建设科技(深圳)有限公司Construction method, device, equipment and the storage medium of Docker container
CN110515625A (en)*2019-08-022019-11-29苏州浪潮智能科技有限公司 Task construction method, apparatus, device, and computer-readable storage medium
CN110851211A (en)*2019-11-132020-02-28北京云途腾科技有限责任公司Method, apparatus, electronic device, and medium for displaying application information
CN111221572A (en)*2020-01-132020-06-02北京字节跳动网络技术有限公司Method, device, medium and equipment for automatically adapting to operating environment
CN111309304A (en)*2020-02-112020-06-19北京字节跳动网络技术有限公司Method, device, medium and electronic equipment for generating IDL file
CN111562942A (en)*2020-04-302020-08-21中国银行股份有限公司Gitlab-based mobile APP continuous integration device and method
CN111767058A (en)*2020-06-302020-10-13上海商汤智能科技有限公司 Program compiling method and device, electronic device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ADWM65461: "如何开发由Create-React-App 引导的应用(二)", pages 12 - 14, Retrieved from the Internet <URL:《https://blog.csdn.net/adwm65461/article/details/102270974》>*

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115705184A (en)*2021-08-062023-02-17中国移动通信有限公司研究院 Data acquisition method, device, electronic device and readable storage medium
CN114579107A (en)*2022-03-112022-06-03北京字跳网络技术有限公司Data processing method, device, equipment and medium

Also Published As

Publication numberPublication date
CN112256326B (en)2023-07-07

Similar Documents

PublicationPublication DateTitle
KR102220127B1 (en)Method and apparatus for customized software development kit (sdk) generation
US11010215B2 (en)Recommending applications based on call requests between applications
CN109408136A (en)Information processing method, device, storage medium and electronic equipment
CN113761588A (en)Data verification method and device, terminal equipment and storage medium
US20170295217A1 (en)Method and system of application development for multiple device client platforms
CN112433730B (en)Code detection rule generation method and device and electronic equipment
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
CN111090423A (en)Webhook framework system and method for realizing active calling and event triggering
CN114979256B (en) Message push method, device, electronic device and computer readable medium
CN110738036A (en) Method and apparatus for generating information
JP2021163475A (en) Log-based mashup code generation
EP3872630B1 (en)Request processing method and apparatus, electronic device, and computer storage medium
CN120010913B (en)General basic capability adaptation method, device and storage medium for micro front end
CN115328627A (en)Data processing method and device
CN112256326A (en)Information processing method, device, equipment and storage medium
US10805419B2 (en)Web application configuration management
CN109949806A (en) Information interaction method and device
CN115600023A (en)Client page skipping method, device and equipment and storage medium
CN111488286B (en)Method and device for independently developing Android modules
CN110519373B (en)Method and device for pushing information
CN112395194A (en)Method and device for accessing test platform
CN109491687B (en)Hot updating method and device of application software, terminal and readable medium
CN111580883A (en)Application program starting method, device, computer system and medium
US20220342742A1 (en)Graphical management of big data pipelines

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp