CN112328304B - Script adaptation method, system, equipment and computer storage medium - Google Patents

Script adaptation method, system, equipment and computer storage medium Download PDF

Info

Publication number
CN112328304B
CN112328304B CN202011084369.7A CN202011084369A CN112328304B CN 112328304 B CN112328304 B CN 112328304B CN 202011084369 A CN202011084369 A CN 202011084369A CN 112328304 B CN112328304 B CN 112328304B
Authority
CN
China
Prior art keywords
execution environment
client
server
script
script file
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
CN202011084369.7A
Other languages
Chinese (zh)
Other versions
CN112328304A (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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202011084369.7A priority Critical patent/CN112328304B/en
Publication of CN112328304A publication Critical patent/CN112328304A/en
Application granted granted Critical
Publication of CN112328304B publication Critical patent/CN112328304B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the technical field of communication, and particularly discloses a script adaptation method, which comprises the following steps: the method comprises the steps that a first client sends a script running request to a first server, the first server obtains an execution environment set corresponding to a script file according to the script file carried by the script running request and sends the execution environment set to a second server, and the execution environment set comprises at least one target execution environment data; the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set and sends the execution environment checking instruction to the second client; and the second client checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set according to the checking instruction, and executes preset operation based on the checking result. The method and the device realize the running of the script file by calling the execution environment with the binding relation with the script file to be run, so as to avoid the problem of running failure caused by the fact that the script file is not matched with the execution environment on the equipment.

Description

Script adaptation method, system, equipment and computer storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a script adaptation method, a system, a device, and a computer storage medium.
Background
In the prior art, when a user clicks a script to execute on an interface of an operation and maintenance platform, the script is issued to a agent at an execution end through a job scheduling module to execute the script of the user, and information such as a log, a parameter output and the like generated during execution is returned to a page operated by the user. When executing the user script on the agent, the execution environment is required to compile and execute the user script, and various operation and maintenance operations are completed according to the action specified in the user script. The execution environment is an environmental support in which the automated operation and maintenance is run for the entire process of operation and maintenance automation.
Because the execution environment itself has a plurality of versions and has a huge third-party dependency library, the downward version compatibility between different versions is not completely achieved, so that a user needs to adapt the operation and maintenance script according to the execution environment on the target machine when writing the script. When a user issues a script through an automation interface to execute on a large number of machines, if the execution environments on the machines are different, the problem that the script is not matched with the execution environment can occur, so that the execution fails.
Disclosure of Invention
The technical problem to be solved by the invention is that in the prior art, the script file is not adapted to the execution environment on the running equipment, so that the running of the script file fails.
In order to solve the technical problems, the invention discloses a script adaptation method, which comprises the following steps:
the first client sends a script running request to the first server,
the first server acquires an execution environment set corresponding to the script file according to the script file carried by the script running request, and sends the script file and the corresponding execution environment set to a second server, wherein the execution environment set comprises at least one target execution environment data;
the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set and sends the execution environment checking instruction to a second client;
and the second client responds to the checking instruction of the second server, checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtains a checking result, and executes a preset operation based on the checking result.
Further, before the first client sends a script running request to the first server, the method further includes:
creating a script file on a first client;
the execution environment set includes at least one target execution environment data determined from the execution environment data stored by the first server;
Establishing, on a first client, an association of the script file with a set of execution environments, the set of execution environments including at least one target execution environment data determined from execution environment data stored by the first server;
the first client sends the associated script file and the execution environment set to the first server;
and after the first server receives the script file and the execution environment set sent by the first client, the script file and the execution environment set are correspondingly stored.
Further, before the association of the script file with the execution environment is established on the first client, the method further includes:
configuring execution environment data on a first client; transmitting the execution environment data to the first server;
and the first server checks the execution environment data, and stores the execution environment data when the check is passed.
In an embodiment, the performing a preset operation based on the inspection result includes:
and when the fact that the execution environment matched with any target execution environment data in the execution environment set exists in the second client is detected, the client identification of the second client is returned to the second server.
In another embodiment, the performing a preset operation based on the inspection result further includes:
when the fact that the execution environment of the second client is not matched with all target execution environment data in the execution environment set is detected, a target execution environment acquisition request is sent to the first server;
the second server sends target execution environment data meeting preset conditions in the execution environment set to the second client according to the target execution environment acquisition request;
and the second client receives the target execution environment data sent by the first server, creates an execution environment according to the received target execution environment data, and returns the client identification of the second client to the second server.
Further, after the returning the client identifier of the second client to the second server, the method further includes:
the second server sends the script file to a second client corresponding to the client identifier;
the second client receives the script file, executes the script file in the execution environment, obtains a script running result, and sends the script running result to the first client.
Further, the invention also provides another implementation method of script adaptation, which comprises the following steps:
a script operation request is sent to a first service, so that the first server obtains an execution environment set corresponding to a script file according to the script file carried by the script operation request, the script file and the corresponding execution environment set are sent to a second server, and the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set and sends the execution environment checking instruction to a second client; the second client responds to the checking instruction of the second server, checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtains a checking result, and executes preset operation based on the checking result; after receiving a client identifier returned by a second client based on the preset operation, the second server sends a script file to the second client corresponding to the client identifier; the second client receives the script file, executes the script file in the execution environment to obtain a script running result, and sends the script running result to the first client; wherein the set of execution environments includes at least one target execution environment;
And receiving a script running result sent by the second client.
Further, the invention also provides another implementation method of script adaptation, which comprises the following steps:
receiving an execution environment checking instruction sent by a second server, checking whether a second client side has an execution environment matched with any target execution environment data in the execution environment set, obtaining a checking result, and executing preset operation based on the checking result, wherein the checking instruction is generated by the second server according to a script file and an execution environment set corresponding to the script file, and the execution environment set is determined by a first server according to the script file carried in a script operation request sent by the first client side;
returning a client identifier of a second client to a second server, wherein the client identifier is the client identifier of the second client returned to a second service when the second client detects that an execution environment matched with any target execution environment data in the execution environment set exists in the second client; or,
the client identifier is that when the second client detects that the execution environment of the second client is not matched with all target execution environment data in the execution environment set, a target execution environment acquisition request is sent to the first server; the second server sends target execution environment data meeting preset conditions in the execution environment set to the second client according to the target execution environment acquisition request; the second client receives the target execution environment data sent by the first server, and when an execution environment is created according to the received target execution environment data, the client identifier of the second client is returned to the second server;
Receiving a script file sent by the second server, and executing the script file in the execution environment to obtain a script running result;
and sending the script running result to the first client.
Further, the invention also provides a script adaptation system, which comprises:
the first client is used for sending a script running request to the first service and receiving a script running result sent by the second client;
the first server is used for receiving a script running request sent by the first client, acquiring an execution environment set corresponding to the script file according to the script file carried by the script running request, and sending the script file and the corresponding execution environment set to the second server, wherein the execution environment set comprises at least one target execution environment data;
the second server is used for generating an execution environment checking instruction according to the script file and the corresponding execution environment set sent by the first server and sending the execution environment checking instruction to a second client;
and the second client is used for responding to the checking instruction of the second server, checking whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtaining a checking result, executing preset operation based on the checking result, receiving a script file sent by the second server, executing the script file under the execution environment, obtaining a script operation result, and sending the script operation result to the first client.
Furthermore, the invention also provides script adaptation equipment, which comprises a processor and a memory, wherein at least one instruction, at least one section of program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by the processor to realize the script adaptation method.
Further, the present invention also provides a computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by a processor to implement a script adaptation method as described above.
The method comprises the steps that a script running request is sent to a first server through a first client; the first server acquires an execution environment set corresponding to the script file according to the script file carried by the script operation request, and sends the script file and the corresponding execution environment set to the second server, wherein the execution environment set comprises at least one target execution environment data; the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set and sends the execution environment checking instruction to the second client; the second client responds to the checking instruction of the second server, checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtains a checking result, executes preset operation based on the checking result, and calls an execution environment with a binding relation with the script file to be executed when the script file is executed, so that the script file is executed, and the problem of operation failure caused by the fact that the script file is not matched with the execution environment on the equipment is avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a hardware system for performing a script adaptation method in accordance with the present invention;
FIG. 2 is a flow chart of a script adaptation method in accordance with one embodiment of the present invention;
FIG. 3 is a schematic diagram of the association of a build script file with execution environment data in accordance with the present invention;
FIG. 4 is a flow chart of a script adaptation method according to another embodiment of the present invention;
FIG. 5 is a flow chart of a script adaptation method according to another embodiment of the present invention;
fig. 6 is a schematic hardware structure of a client for implementing the method provided by the embodiment of the present invention;
fig. 7 is a schematic diagram of a hardware structure of a server for implementing the method provided by the embodiment of the present invention;
in the figure, a first client, a second client, a first server and a second server are respectively shown as 10, 20, 30 and 40;
1010-RF circuitry, 1020-memory, 1030-input unit, 1031-touch-sensitive surface, 1032-other input device, 1040-display unit, 1041-display panel, 1050-sensor, 1060-audio circuitry, 1061-speaker, 1062-audio interface, 1070-WiFi module, 1080-processor, 1090-power supply;
3010-central processing unit, 3020-storage medium, 3021-operating system, 3022-data, 3023-application, 3030-memory, 3040-input/output interface, 3050-wired or wireless network interface, 3060-power supply.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
Reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic may be included in at least one implementation of the invention. In the description of the present invention, it should be understood that the terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the above-described figures are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Examples:
in order to solve the technical problems, the invention discloses a script adaptation method, and firstly, the embodiment of the invention discloses an implementation environment of the script adaptation method in a feasible embodiment.
Referring to fig. 1, the implementation environment includes a first client 10, a second client 20, a first server 30, and a second server 40.
The first client 10 and the second client 20 may each include: tablet computers, notebook computers, digital assistants, intelligent wearable devices, vehicle terminals and other types of physical devices, and may also include software running in the physical devices, such as application programs with script running functions.
The first client may send a script running request to the first server 30 and receive a script running result sent by the second client 20; the first server 30 may receive a script operation request sent by the first client 10, obtain an execution environment set corresponding to the script file according to the script file carried by the script operation request, and send the script file and the corresponding execution environment set to the second server 40, where the execution environment set includes at least one target execution environment data; the second server 40 may generate an execution environment checking instruction according to the script file and the corresponding execution environment set sent by the first server 30, and send the execution environment checking instruction to the second client 20;
The second client 20 may respond to the checking instruction of the second server 40, check whether the second client 20 has an execution environment matching any target execution environment data in the execution environment set, obtain a checking result, execute a preset operation and receive a script file sent by the second server 40 based on the checking result, execute the script file in the execution environment, obtain a script running result, and send the script running result to the first client 10.
It is understood that at least one of the first client 10, the second client 20, the first server 30 and the second server 40 may be at least one of the first server 30 and the second server 40, and each of the first server 30 and the second server 40 may include a server that operates independently, or a distributed server, or a server cluster composed of a plurality of servers. The Client and the Server may communicate through HTTP protocol, the Server and the Server may be connected through a network, and the first Client 10 and the second Client 20 may be communicatively connected to the first Server 30 or the second Server 40 based on Browser/Server (B/S) or Client/Server (Client/Server) mode. It will be appreciated that the above network includes, but is not limited to: the client is not limited to a PC, a mobile phone, a tablet computer, etc.
Further, fig. 2 is an optional script adaptation method according to an embodiment of the present invention, specifically, the method includes:
s200, a first client sends a script running request to a first server;
it will be appreciated that the first client may be, but is not limited to, a PC, a cell phone, a tablet computer, and that communication between the first server and the first client may be via the HTTP protocol (a simple request-response protocol, which typically runs on top of TCP.
The script running request may be triggered based on a user clicking a script running button preset on the first client interface, and the first client forwards the triggering operation to the first server.
Further, before the first client sends the script running request to the first server, the method further includes:
s100, creating a script file on a first client;
it will be appreciated that script files are computer programming languages created to shorten the traditional write-compile-link-run (edit-link) process. The script file is created on the first client, which may be that the user uses a browser to directly write the script in the web page provided by the service monitoring system or upload the existing script file, and the browser helps the user to transmit the script to the first server in an HTTP manner after submitting the script file. Preferably, the language for creating the script file may be any of JavaScript or VBScript or Shell or python or Lua, etc.
Further, after the user creates the script file on the first client, the first client may send the created script file to the first server, and the first server stores the script file after receiving the script file sent by the first client. Preferably, the first server may store the received script file in mongabd (database based on distributed file storage).
S102, configuring execution environment data on a first client;
it is understood that the execution environment refers to the dependency conditions required by the script file when running on the target client, including information such as execution environment descriptive files, dependency packages, configuration files, interpreters of the script development language, and the like.
The configuring of the execution environment data on the first client may be that the user transmits the execution environment data that has been written to the first client.
It can be appreciated that the execution environment is self-written for the user according to the execution environment creation specification, and can meet the requirement of the user personalized execution environment, wherein the execution creation specification is determined based on the analysis specification of the agent (refer to the software or hardware entity capable of autonomous activity, and is usually translated into an agent), and the analysis specification can be preset by a developer.
S104, sending the execution environment data to a first server;
s106, checking the execution environment data by the first server, and storing the execution environment data when the checking is passed.
It can be understood that the first client and the first server can perform data transmission through HTTP protocol, and after receiving the execution environment data sent by the first client, the first server checks the execution environment data, which mainly includes checking whether the execution environment data uploaded by the first client meets the execution environment data making specification. And further performs the following operations:
if the check is passed, that is, if the execution environment data meets the production specification of the execution environment data, the execution environment data meeting the production specification of the execution environment data is locally stored. Preferably, the first server may store the execution environment data conforming to the execution environment data creation specification in a Ceph (distributed file system) of the first server. And after storing, sending an instruction to create an association button to the first client based on the stored execution environment data conforming to the production specification, so that the first client creates the association button on the first client based on the received instruction to create the association button. It will be appreciated that when the associated button is triggered, all the target execution environment data stored in the first server may be revealed based on the triggering operation of the associated button.
It may further be appreciated that if the first server detects that the received execution environment data sent by the first client does not meet the production specification, the first server returns a check result to the first client, and sends a correction instruction to the first client, so that the first client displays the correction instruction sent by the first server and the check result on a display interface of the first client, so that the user can modify the execution environment based on the display content of the interface. It may be understood that the display interface may be a web interface of the first client, or may be a display screen interface of the first client; the execution environment data does not conform to the specification, and any of the execution environment data does not conform to the specification.
By checking the manufacturing specification of the execution environment, the problem that the final analysis fails due to the fact that the execution environment data which does not accord with the manufacturing specification of the execution environment is configured to the created script file can be avoided.
S108, establishing association between the script file and the execution environment set on the first client;
as shown in fig. 3, the association of the script file and the execution environment set may specifically be established on the first client, where the user clicks an association button, and all the target execution environment data stored in the first server displayed after the association button is associated, and based on the user selecting the target execution environment data adapted to the created script file, at least one of the selected target execution environment data is selected, so as to implement the association of at least one target execution environment data and the created script file. It will be appreciated that the selected target execution environment data together form an execution environment set, and that upon selection of the target execution environment data associated with the created script file by the user, the association of the script file with the execution environment set on the first client is completed. .
S110, the first client sends the associated script file and the execution environment set to a first server;
s112, after the first server receives the script file and the execution environment set sent by the first client, the script file and the execution environment set are correspondingly stored.
Specifically, after the association relationship between the script file and the execution environment is created on the first client, the first client may send the script file and the execution environment set to the first server together, and after receiving the script file and the execution environment set sent by the first client, the first server correspondingly stores the script file and the execution environment based on the association relationship between the script file and the execution environment set. Preferably, the first server may store the script file and the execution environment in association with each other in Mysql (relational database management system) of the second server, and the storage format may be < script ID, execution environment set (target execution environment data ID1, target execution environment data ID2, target execution environment data ID3 … …) >.
S202, the first server acquires an execution environment set corresponding to the script file according to the script file carried by the script operation request, and sends the script file and the corresponding execution environment set to the second server;
It is appreciated that the set of execution environments includes at least one target execution environment data;
the first server obtains an execution environment set corresponding to the script file according to the script file carried by the script operation request, wherein the execution environment set specifically comprises execution environments matched with the script file carried in the script operation request from all the execution environment sets stored in the first server. And matching and searching can be performed through preset identification information.
S204, the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set, and sends the execution environment checking instruction to the second client;
s206, the second client responds to the checking instruction of the second server, checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtains a checking result, and executes a preset operation based on the checking result.
In one implementation, if it is checked that there is an execution environment in the second client that matches any of the target execution environment data in the execution environment set, step S208 is performed. If it is checked that the execution environment of the second client does not match all the target execution environment data in the execution environment set, step S210 is performed.
S208, the client identification of the second client is returned to the second server.
S210, sending a target execution environment acquisition request to a first server;
it will be appreciated that sending a target execution environment acquisition request to the first server is specifically sending a request to the first server to acquire target execution environment data that can execute the script file described above.
S212, the second server sends target execution environment data meeting preset conditions in the execution environment set to the second client according to the target execution environment acquisition request;
it may be appreciated that the preset condition may include version information, network information, memory information, etc. of the second client.
S214, the second client receives the target execution environment data sent by the first server, creates an execution environment according to the received target execution environment data, and returns the client identification of the second client to the second server.
Specifically, the second client receives the target execution environment data sent by the first server, and creates an execution environment according to the received target execution environment data, and specifically, after receiving the target execution environment data sent by the first server, the second client analyzes the target execution environment data, and installs the execution environment based on the analysis result.
It may be appreciated that the second client may also automatically update the current execution environment according to the obtained target execution environment data. Operations such as running state checking, automatic maintenance or unloading can be performed on the installed or updated execution environment.
It can be understood that after the second client receives the target execution environment data sent by the first server, the second client performs the tasks of automatic installation, automatic update, automatic maintenance, automatic unloading and the like of the execution environment based on the target execution environment data, so that a user can be liberated from the heavy work of maintaining the execution environment, the operation and maintenance efficiency is improved, and the operation and maintenance cost is reduced.
Further, after the client identifier of the second client is returned to the second server, the method further includes:
s300, the second server sends the script file to a second client corresponding to the client identifier;
s302, the second client receives the script file, executes the script file in the execution environment, obtains a script operation result, and sends the script operation result to the first client.
The method comprises the steps that a script running request is sent to a first server through a first client; the first server acquires an execution environment set corresponding to the script file according to the script file carried by the script operation request, and sends the script file and the corresponding execution environment set to the second server, wherein the execution environment set comprises at least one target execution environment data; the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set and sends the execution environment checking instruction to the second client; the second client responds to the checking instruction of the second server, checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtains a checking result, executes preset operation based on the checking result, and calls an execution environment with a binding relation with the script file to be executed when the script file is executed, so that the script file is executed, and the problem of operation failure caused by the fact that the script file is not matched with the execution environment on the equipment is avoided.
Further, the invention also provides another implementation method of script adaptation, as shown in fig. 4, the method includes:
s400, a script operation request is sent to a first service, so that the first server obtains an execution environment set corresponding to a script file according to the script file carried by the script operation request, the script file and the corresponding execution environment set are sent to a second server, and the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set and sends the execution environment checking instruction to a second client; the second client responds to the checking instruction of the second server, checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtains a checking result, and executes preset operation based on the checking result; after receiving a client identifier returned by a second client based on the preset operation, the second server sends a script file to the second client corresponding to the client identifier; the second client receives the script file, executes the script file in the execution environment to obtain a script running result, and sends the script running result to the first client; wherein the set of execution environments includes at least one target execution environment; wherein the set of execution environments includes at least one target execution environment;
S402, receiving a script running result sent by the second client.
Further, the invention also provides another implementation method of script adaptation, as shown in fig. 5, the method includes:
s500, receiving an execution environment checking instruction sent by a second server, checking whether the second client has an execution environment matched with any target execution environment data in an execution environment set, obtaining a checking result, and executing preset operation based on the checking result;
it can be understood that the checking instruction is generated by the second server according to the script file and the execution environment set corresponding to the script file, and the execution environment set is determined by the first server according to the script file carried in the script operation request sent by the first client;
s502, returning the client identification of the second client to the second server;
it can be understood that the client identifier is a client identifier of the second client returned to the second service when the second client detects that an execution environment matched with any target execution environment data in the execution environment set exists in the second client; or,
the client identifier is that when the second client detects that the execution environment of the second client is not matched with all target execution environment data in the execution environment set, a target execution environment acquisition request is sent to the first server; the second server sends target execution environment data meeting preset conditions in the execution environment set to the second client according to the target execution environment acquisition request; the second client receives the target execution environment data sent by the first server, and when an execution environment is created according to the received target execution environment data, the client identifier of the second client is returned to the second server;
S503, receiving a script file sent by a second server, and executing the script file in an execution environment to obtain a script running result;
s504, the script running result is sent to the first client.
The method comprises the steps that a script running request is sent to a first server through a first client; the first server acquires an execution environment set corresponding to the script file according to the script file carried by the script operation request, and sends the script file and the corresponding execution environment set to the second server, wherein the execution environment set comprises at least one target execution environment data; the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set and sends the execution environment checking instruction to the second client; the second client responds to the checking instruction of the second server, checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtains a checking result, executes preset operation based on the checking result, and calls an execution environment with a binding relation with the script file to be executed when the script file is executed, so that the script file is executed, and the problem of operation failure caused by the fact that the script file is not matched with the execution environment on the equipment is avoided.
Furthermore, the invention also provides script adaptation equipment, which comprises a processor and a memory, wherein at least one instruction, at least one section of program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by the processor to realize the script adaptation method disclosed by the embodiment of the invention.
Further, the present invention also provides a computer readable storage medium, where at least one instruction, at least one section of program, a code set, or an instruction set is stored, where the at least one instruction, the at least one section of program, the code set, or the instruction set is loaded and executed by a processor to implement a script adaptation method according to an embodiment of the present invention.
Alternatively, in the present embodiment, the above-mentioned computer storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Furthermore, the invention also provides a hardware structure schematic diagram of the client for realizing the method provided by the embodiment of the invention. As shown in fig. 6, the client may be used to implement the script adaptation method provided in the above-described embodiments. Specifically, the present invention relates to a method for manufacturing a semiconductor device.
The clients in this embodiment refer to a generic term of the first client 10 and the second client 20, and the structures of the first client 10 and the second client 20 are the same, and the following description will be made with the first client 10 as the client in this embodiment:
the client may include RF (Radio Frequency) circuitry 1010, memory 1020 including one or more computer-readable storage media, input unit 1030, display unit 1040, sensor 1050, audio circuitry 1060, wiFi (wireless fidelity ) module 1070, processor 1080 including one or more processing cores, and power source 1090. Those skilled in the art will appreciate that the client architecture shown in fig. 6 is not limiting and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the RF circuit 1010 may be used for receiving and transmitting signals during a message or a call, and in particular, after receiving downlink information of a base station, the downlink information is processed by one or more processors 1080; in addition, data relating to uplink is transmitted to the base station. Typically, RF circuitry 1010 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier ), a duplexer, and the like. In addition, the RF circuitry 1010 may also communicate with networks and other clients via wireless communications. The wireless communication may use any communication standard or protocol including, but not limited to, GSM (Global System of Mobile communication, global system for mobile communications), GPRS (General Packet Radio Service ), CDMA (Code Division Multiple Access, code division multiple access), WCDMA (Wideband Code Division Multiple Access ), LTE (Long Term Evolution, long term evolution), email, SMS (Short Messaging Service, short message service), and the like.
Memory 1020 may be used to store software programs and modules that processor 1080 performs various functional applications and data processing by executing the software programs and modules stored in memory 1020. The memory 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for functions, and the like; the storage data area may store data created according to the use of the client, etc. In addition, memory 1020 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state memory device. Accordingly, the memory 1020 may also include a memory controller to provide access to the memory 1020 by the processor 880 and the input unit 1030.
The input unit 1030 may be used for receiving input numeric or character information and generating keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 1030 may include a touch-sensitive surface 1031 and other input devices 1032. The touch-sensitive surface 1031, also referred to as a touch display screen or touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch-sensitive surface 1031 or thereabout using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection device according to a pre-set program. Alternatively, the touch sensitive surface 1031 may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 1080 and can receive commands from the processor 1080 and execute them. In addition, the touch sensitive surface 1031 may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 1031, the input unit 1030 may include other input devices 1032. In particular, other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a track ball, a mouse, a joystick, etc.
The display unit 1040 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the client, which may be composed of graphics, text, icons, video and any combination thereof. The display unit 1040 may include a display panel 1041, and alternatively, the display panel 1041 may be configured in the form of an LCD (Liquid Crystal Display ), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch sensitive surface 1031 can overlay the display panel 1041, and upon detection of a touch operation thereon or thereabout by the touch sensitive surface 1031, is communicated to the processor 1080 to determine a type of touch event, and the processor 1080 then provides a corresponding visual output on the display panel 1041 based on the type of touch event. Wherein the touch-sensitive surface 1031 and the display panel 1041 can be two separate components for input and output functions, but in some embodiments the touch-sensitive surface 1031 can be integrated with the display panel 1041 for input and output functions.
The client may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1041 and/or the backlight when the client moves to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking) and the like for recognizing the gesture of the client; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may be configured by the client are not described in detail herein.
Audio circuitry 1060, a speaker 1061, and a microphone 1062 may provide an audio interface between a user and the client. Audio circuit 1060 may transmit the received electrical signal after audio data conversion to speaker 1061 for conversion by speaker 1061 into an audio signal output; on the other hand, microphone 1062 converts the collected sound signals into electrical signals, which are received by audio circuit 1060 and converted into audio data, which are processed by audio data output processor 1080 for transmission to, for example, another client via RF circuit 1010 or for output to memory 1020 for further processing. Audio circuitry 1060 may also include an ear bud jack to provide communication of peripheral headphones with the client.
WiFi belongs to a short-distance wireless transmission technology, and the client can help a user to send and receive e-mails, browse web pages, access streaming media and the like through a WiFi module 1070, so that wireless broadband Internet access is provided for the user. Although fig. 6 shows a WiFi module 1070, it is understood that it does not belong to the necessary constitution of the client, and can be omitted entirely as required within the scope of not changing the essence of the invention.
Processor 1080 is the control center of the client, connects the various parts of the entire client using various interfaces and lines, and performs the various functions and processes of the client by running or executing software programs and/or modules stored in memory 1020, and invoking data stored in memory 1020, thereby performing overall monitoring of the client. Optionally, processor 1080 may include one or more processing cores; preferably, processor 1080 may integrate an application processor primarily handling operating systems, user interfaces, applications, etc., with a modem processor primarily handling wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1080.
The client also includes a power source 1090 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 1080 via a power management system so as to provide for managing charge, discharge, and power consumption by the power management system. The power source 1090 may also include one or more of any of a direct current or alternating current power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the client may further include a camera, a bluetooth module, etc., which will not be described herein. In particular, in this embodiment, the display unit of the client is a touch screen display, and the client further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors.
Further, the invention also provides a hardware structure schematic diagram of the server for realizing the method provided by the embodiment of the invention; as shown in fig. 7, the server is configured to implement the script adaptation method provided in the above embodiment, specifically:
the servers in the embodiment refer to a generic term of the first server 30 and the second server 40, and the structures of the first server 30 and the second server 40 are the same, and the description is made below with the first server 30 as the server in the present embodiment:
the server structure may comprise means for identifying proxy internet protocol, IP, addresses as described above. The server 30 may vary considerably in configuration or performance and may include one or more central processing units (Central Processing Units, CPU) 3010 (e.g., one or more processors) and memory 3030, one or more storage media 3020 (e.g., one or more mass storage devices) storing applications 3023 or data 3022. Wherein the memory 3030 and the storage medium 3020 may be transitory or persistent storage. The program stored on the storage medium 3020 may include one or more modules, each of which may include a series of instruction operations on the server. Still further, the central processor 3010 may be configured to communicate with a storage medium 3020 to execute a series of instruction operations in the storage medium 3020 on the server 30. The server 30 may also include one or more power supplies 3060, one or more wired or wireless network interfaces 3050, one or more input/output interfaces 3040, and/or one or more operating systems 3021, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, and the like.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (11)

1. A script adaptation method, the method comprising:
the method comprises the steps that a first client sends a script running request to a first server;
the first server acquires an execution environment set corresponding to the script file according to the script file carried by the script running request, and sends the script file and the corresponding execution environment set to a second server, wherein the execution environment set comprises at least one target execution environment data;
the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set and sends the execution environment checking instruction to a second client;
And the second client responds to the checking instruction of the second server, checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtains a checking result, and executes a preset operation based on the checking result.
2. The script adaptation method of claim 1, wherein before the first client sends a script running request to the first server, the method further comprises:
creating a script file on a first client;
establishing, on a first client, an association of the script file with a set of execution environments, the set of execution environments including at least one target execution environment data determined from execution environment data stored by the first server;
the first client sends the associated script file and the execution environment set to the first server;
and after the first server receives the script file and the execution environment set sent by the first client, the script file and the execution environment data are correspondingly stored.
3. The script adaptation method of claim 2, wherein prior to establishing the association of the script file with the set of execution environments on the first client, the method further comprises:
Configuring execution environment data on a first client;
transmitting the execution environment data to the first server;
and the first server checks the execution environment data, and stores the execution environment data when the check is passed.
4. A script adaptation method as claimed in claim 3, wherein said performing a preset operation based on said checking result comprises:
and when the fact that the execution environment matched with any target execution environment data in the execution environment set exists in the second client is detected, the client identification of the second client is returned to the second server.
5. The script adaptation method of claim 3, wherein the performing a preset operation based on the inspection result further comprises:
when the fact that the execution environment of the second client is not matched with all target execution environment data in the execution environment set is detected, a target execution environment acquisition request is sent to the first server;
the second server sends target execution environment data meeting preset conditions in the execution environment set to the second client according to the target execution environment acquisition request;
And the second client receives the target execution environment data sent by the first server, creates an execution environment according to the received target execution environment data, and returns the client identification of the second client to the second server.
6. The script adaptation method according to claim 4 or 5, wherein after the returning the client identifier of the second client to the second server, the method further comprises:
the second server sends the script file to a second client corresponding to the client identifier;
the second client receives the script file, executes the script file in the execution environment, obtains a script running result, and sends the script running result to the first client.
7. A script adaptation method, the method comprising:
a script operation request is sent to a first service, so that the first server obtains an execution environment set corresponding to a script file according to the script file carried by the script operation request, the script file and the corresponding execution environment set are sent to a second server, and the second server generates an execution environment checking instruction according to the script file and the corresponding execution environment set and sends the execution environment checking instruction to a second client; the second client responds to the checking instruction of the second server, checks whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtains a checking result, and executes preset operation based on the checking result; after receiving a client identifier returned by a second client based on the preset operation, the second server sends a script file to the second client corresponding to the client identifier; the second client receives the script file, executes the script file in the execution environment to obtain a script running result, and sends the script running result to the first client; wherein the set of execution environments includes at least one target execution environment;
And receiving a script running result sent by the second client.
8. A script adaptation method, the method comprising:
receiving an execution environment checking instruction sent by a second server, checking whether a second client side has an execution environment matched with any target execution environment data in the execution environment set, obtaining a checking result, and executing preset operation based on the checking result, wherein the checking instruction is generated by the second server according to a script file and an execution environment set corresponding to the script file, and the execution environment set is determined by a first server according to the script file carried in a script operation request sent by the first client side;
returning a client identifier of a second client to a second server, wherein the client identifier is the client identifier of the second client returned to a second service when the second client detects that an execution environment matched with any target execution environment data in the execution environment set exists in the second client; or,
the client identifier is that when the second client detects that the execution environment of the second client is not matched with all target execution environment data in the execution environment set, a target execution environment acquisition request is sent to the first server; the second server sends target execution environment data meeting preset conditions in the execution environment set to the second client according to the target execution environment acquisition request; the second client receives the target execution environment data sent by the first server, and when an execution environment is created according to the received target execution environment data, the client identifier of the second client is returned to the second server;
Receiving a script file sent by the second server, and executing the script file in the execution environment to obtain a script running result;
and sending the script running result to the first client.
9. A script adaptation system, the system comprising:
the first client is used for sending a script running request to the first service and receiving a script running result sent by the second client;
the first server is used for receiving a script running request sent by the first client, acquiring an execution environment set corresponding to the script file according to the script file carried by the script running request, and sending the script file and the corresponding execution environment set to the second server, wherein the execution environment set comprises at least one target execution environment data;
the second server is used for generating an execution environment checking instruction according to the script file and the corresponding execution environment set sent by the first server and sending the execution environment checking instruction to a second client;
and the second client is used for responding to the checking instruction of the second server, checking whether the second client has an execution environment matched with any target execution environment data in the execution environment set, obtaining a checking result, executing preset operation based on the checking result and receiving a script file sent by the second server, executing the script file under the execution environment, obtaining a script operation result, and sending the script operation result to the first client.
10. A script adaptation device, characterized in that it comprises a processor and a memory, in which at least one instruction, at least one program, set of codes or set of instructions is stored, which is loaded and executed by the processor to implement the script adaptation method of any of claims 1 to 6 or claim 7 or claim 8.
11. A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, the code set, or instruction set being loaded and executed by a processor to implement the script adaptation method of any of claims 1 to 6 or claim 7 or claim 8.
CN202011084369.7A 2020-10-12 2020-10-12 Script adaptation method, system, equipment and computer storage medium Active CN112328304B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011084369.7A CN112328304B (en) 2020-10-12 2020-10-12 Script adaptation method, system, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011084369.7A CN112328304B (en) 2020-10-12 2020-10-12 Script adaptation method, system, equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN112328304A CN112328304A (en) 2021-02-05
CN112328304B true CN112328304B (en) 2024-04-09

Family

ID=74314781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011084369.7A Active CN112328304B (en) 2020-10-12 2020-10-12 Script adaptation method, system, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN112328304B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108351796A (en) * 2015-10-27 2018-07-31 甲骨文金融服务软件有限公司 Unified interface specification for interacting and executing model with model in various runtime environments
CN110365724A (en) * 2018-04-08 2019-10-22 腾讯科技(深圳)有限公司 Task processing method, device and electronic equipment
CN110471719A (en) * 2019-08-16 2019-11-19 北京明略软件系统有限公司 Operation method and device, storage medium, the electronic device of script file
CN110941391A (en) * 2019-10-18 2020-03-31 苏州浪潮智能科技有限公司 Method and system for inquiring cluster operation environment information

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0311868D0 (en) * 2003-05-23 2003-06-25 Ibm Creation of a script for executing commands
US9292282B2 (en) * 2009-03-31 2016-03-22 International Business Machines Corporation Server-side translation for custom application support in client-side scripts

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108351796A (en) * 2015-10-27 2018-07-31 甲骨文金融服务软件有限公司 Unified interface specification for interacting and executing model with model in various runtime environments
CN110365724A (en) * 2018-04-08 2019-10-22 腾讯科技(深圳)有限公司 Task processing method, device and electronic equipment
CN110471719A (en) * 2019-08-16 2019-11-19 北京明略软件系统有限公司 Operation method and device, storage medium, the electronic device of script file
CN110941391A (en) * 2019-10-18 2020-03-31 苏州浪潮智能科技有限公司 Method and system for inquiring cluster operation environment information

Also Published As

Publication number Publication date
CN112328304A (en) 2021-02-05

Similar Documents

Publication Publication Date Title
CN106970790B (en) Application program creating method, related equipment and system
CN107040609B (en) Network request processing method and device
CN109857403B (en) Page updating method and device, page processing method and device
CN108039963B (en) Container configuration method and device and storage medium
CN106502703B (en) Function calling method and device
CN106775827B (en) Application program updating method and device and computer equipment
CN109947650B (en) Script step processing method, device and system
CN106775828B (en) Application program installation method and device and computer equipment
EP2869604B1 (en) Method, apparatus and device for processing a mobile terminal resource
CN112749074B (en) Test case recommending method and device
CN114115895A (en) Code query method and device, electronic equipment and storage medium
CN109688611B (en) Frequency band parameter configuration method, device, terminal and storage medium
CN106095423B (en) Method, terminal and server for providing browsing service
CN105528220B (en) Method and device for loading dynamic shared object
CN112328304B (en) Script adaptation method, system, equipment and computer storage medium
CN106933626B (en) Application association method and device
CN107122204B (en) Application unloading state detection method and device
CN106817370B (en) Method and device for transmitting network data
US10057740B2 (en) Methods and devices for processing mobile terminal resource
CN114707793A (en) Emergency plan generation method and device, storage medium and electronic equipment
CN108280798B (en) Method and device for rendering and displaying browser kernel
CN110309454B (en) Interface display method, device, equipment and storage medium
CN112035180A (en) Automatic instance loading method and device, electronic equipment and storage medium
CN112667868A (en) Data detection method and device
CN114189436B (en) Multi-cluster configuration deployment method and device, electronic equipment and storage medium

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