CN111258685A - Script calling method, device, equipment and computer readable storage medium - Google Patents

Script calling method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111258685A
CN111258685A CN202010092511.6A CN202010092511A CN111258685A CN 111258685 A CN111258685 A CN 111258685A CN 202010092511 A CN202010092511 A CN 202010092511A CN 111258685 A CN111258685 A CN 111258685A
Authority
CN
China
Prior art keywords
script
algorithm
calling
request
call request
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.)
Pending
Application number
CN202010092511.6A
Other languages
Chinese (zh)
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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010092511.6A priority Critical patent/CN111258685A/en
Publication of CN111258685A publication Critical patent/CN111258685A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a script calling method, which comprises the following steps: when a call request is received, determining whether the call request meets a preset condition based on a public routing address; if the calling request meets a preset condition, inquiring a corresponding algorithm script in an algorithm database based on the calling request; and running the algorithm script based on the calling request to obtain a running result corresponding to the calling request. The invention also discloses a script calling device, equipment and a computer readable storage medium. According to the invention, the algorithm script corresponding to the algorithm container is called through the public routing address, the calling of different algorithm scripts can be realized through the public routing address, different routing URL path rules do not need to be set for different algorithm scripts, the development cost and the access threshold are further reduced, and the algorithm script access convenience is improved.

Description

Script calling method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a script calling method, device, and apparatus, and a computer-readable storage medium.
Background
At present, model training and prediction capabilities provided by algorithm scripts are often required to be called by upper-layer applications of a system, so that model training and prediction services are often realized by constructing an intermediate algorithm Container layer to call underlying algorithm logic, for example, constructing an algorithm Container (Algo-Container) platform to call different algorithm scripts.
However, when different algorithm scripts are called by an application, or different applications call different algorithm scripts, modification of a route URL (Uniform Resource Locator) path rule corresponding to an algorithm container needs to be performed to call different algorithm scripts through different route URL path rules, so that a call process of a script algorithm is complicated, access difficulty of different services is increased, and technical development cost is increased.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a script calling method, a script calling device and a computer readable storage medium, and aims to solve the technical problem that the calling process of a script algorithm is complex due to the fact that different algorithm scripts are called through different routing URL paths.
In order to achieve the above object, the present invention provides a script calling method, including the following steps:
when a call request is received, determining whether the call request meets a preset condition based on a public routing address;
if the calling request meets a preset condition, inquiring a corresponding algorithm script in an algorithm database based on the calling request;
and running the algorithm script based on the calling request to obtain a running result corresponding to the calling request.
Further, the step of determining whether the invocation request meets a preset condition based on the public routing address comprises:
acquiring a Uniform Resource Locator (URL) corresponding to the calling request;
and determining whether the URL is matched with the public routing address, wherein if the URL is matched with the public routing address, the calling request is determined to meet a preset condition.
Further, the step of determining whether the invocation request meets a preset condition based on the public routing address when the invocation request is received comprises:
when a call request is received, determining whether the call request is a Post request;
and if the calling request is a Post request, determining whether the calling request meets a preset condition based on a public routing address.
Further, the step of querying a corresponding algorithm script in an algorithm database based on the call request includes:
acquiring a preset message body data format;
and inquiring the algorithm script in an algorithm database based on the preset message body data format and the calling request.
Further, the step of querying the algorithm script in an algorithm database based on the preset message body data format and the call request includes:
analyzing the calling request based on the preset message body data format to obtain a script name and a script version number corresponding to the algorithm script;
and inquiring the algorithm script in an algorithm database based on the script name and the script version number.
Further, the step of executing the algorithm script based on the call request to obtain an execution result corresponding to the call request includes:
acquiring script parameters corresponding to the calling request;
and running the algorithm script based on the script parameters to obtain a running result corresponding to the calling request.
Further, the step of obtaining the script parameter corresponding to the call request includes:
analyzing the calling request based on a preset message body data format to obtain the script parameters, wherein the script parameters comprise a method name and application parameters of an algorithm script;
the step of running the algorithm script based on the script parameters comprises:
and transmitting the application parameters to the method corresponding to the method name in the algorithm script so as to run the algorithm script.
Further, before the step of determining whether the call request satisfies the preset condition based on the public routing address when the call request is received, the script call method further includes:
and the application acquires script information and script parameters, generates the call request based on the public routing address, the script information and the script parameters according to a preset message body data format, and sends the call request based on the Post request.
In addition, to achieve the above object, the present invention further provides a script calling apparatus, including:
the determining module is used for determining whether the calling request meets a preset condition or not based on the public routing address when the calling request is received;
the query module is used for querying a corresponding algorithm script in an algorithm database based on the call request if the call request meets a preset condition;
and the operation module is used for operating the algorithm script based on the calling request so as to obtain an operation result corresponding to the calling request.
In addition, to achieve the above object, the present invention further provides a script calling device, including: the device comprises a memory, a processor and a script calling program which is stored on the memory and can run on the processor, wherein the script calling program realizes the steps of the script calling method when being executed by the processor.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium, which stores a script calling program, and the script calling program implements the steps of the script calling method when being executed by a processor.
When a call request is received, determining whether the call request meets a preset condition or not based on a public routing address; then if the calling request meets the preset condition, inquiring a corresponding algorithm script in an algorithm database based on the calling request; and then the algorithm script is operated based on the calling request, the operation result is fed back to the application, the algorithm script corresponding to the algorithm container is called through the public routing address, the calling of different algorithm scripts can be realized through the public routing address, different routing URL path rules do not need to be set for different algorithm scripts, the development cost and the access threshold are further reduced, and the algorithm script access convenience is improved.
Drawings
FIG. 1 is a schematic structural diagram of a script calling device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a script calling method according to a first embodiment of the present invention;
FIG. 3 is a schematic diagram of an application scenario in an embodiment of a script calling method according to the present invention;
fig. 4 is a diagram illustrating a predetermined message body data format (message body format) according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a data storage format in an algorithm database according to an embodiment of the present invention
FIG. 6 is a functional block diagram of an embodiment of a script calling apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a schematic structural diagram of a script calling device in a hardware operating environment according to an embodiment of the present invention.
The script calling device in the embodiment of the present invention may be a PC, or may be a mobile terminal device having a display function, such as a smart phone, a tablet computer, an electronic book reader, an MP3(Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4) player, a portable computer, and the like.
As shown in fig. 1, the script calling apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the script invoking device may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. In particular, the light sensor may include an ambient light sensor and a proximity sensor. As one type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), can detect the magnitude and direction of gravity when stationary, and can be used for identifying applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration) in which a script calls the device attitude, and vibration identification related functions (such as pedometer and tapping); of course, the script calling device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, which are not described herein again.
Those skilled in the art will appreciate that the script invocation device architecture shown in FIG. 1 does not constitute a limitation of the script invocation device, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a script calling program.
In the script calling device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to invoke a script calling program stored in the memory 1005.
In this embodiment, the script calling apparatus includes: the system comprises a memory 1005, a processor 1001 and a script calling program which is stored on the memory 1005 and can run on the processor 1001, wherein when the processor 1001 calls the script calling program stored in the memory 1005, the steps of the script calling method in the following embodiments are executed.
The invention also provides a script calling method, and referring to fig. 2, fig. 2 is a flowchart of a first embodiment of the script calling method of the invention.
In this embodiment, the script calling method includes the following steps:
step S100, when a call request is received, determining whether the call request meets a preset condition based on a public routing address;
it should be noted that a common routing address (a common call request routing path) is preset, so that each application in the system calls an underlying algorithm script through the common routing address, and specifically, according to a system architecture, a URL rule of the common routing address is defined, for example, "http:// localhost/api/common prefix/", where localhost is identification Information (ID) of a local host corresponding to the system, and api is a call interface of an application program.
In this embodiment, when the bottom-layer algorithm script needs to be called through the algorithm container layer, the call request including the public routing address is sent based on the Post request of Http, and the algorithm container receives the call request including the public routing address sent based on the Post request by the application.
It should be noted that the first parameter of the open method of the XMLHttpRequest object is request-type, and the value may be get or post. The routing URL corresponding to the existing algorithm container adopts get request, and the parameters are transmitted along with the URL, so that the public routing address can not be adopted. In this embodiment, the Post request is adopted, and the parameter corresponding to the Post request is sent out along with the send method, such as send (data), that is, the parameter corresponding to the Post request does not need to be transferred through the URL, so that the public routing address can be adopted.
Further, in an embodiment, before step S100, the script calling method further includes:
and the application acquires script information and script parameters, generates the call request based on the public routing address, the script information and the script parameters according to a preset message body data format, and sends the call request based on the Post request.
In this embodiment, the call request may be initiated by an application in the system or initiated by another terminal, when an algorithm script in an algorithm container needs to be called, the application acquires script information and script parameters, then the application generates the call request based on the public routing address, the script information and the script parameters according to a preset message body data format, and sends the call request based on a Post request, that is, the call request is sent by a Post request of Http, where the script information includes a script name and a script version number of the algorithm script; the script parameters include the method name and application parameters of the algorithm script.
Specifically, the URL of the call request is the public routing address, the parameters transferred by the send method in the call request include script information and script parameters, and specifically, the script information and the script parameters are arranged in a character string corresponding to the parameters transferred by the send method according to a preset message body data format.
For example, since the length of the parameters transmitted by the send method is not limited, the preset message body data format may include the script name and script version number location information or the identification information corresponding to the script name, script version number, method name and application parameter in the character string corresponding to the parameters transmitted by the send method, different character locations may be set for the script name and script version number of the algorithm script in the script information, the method name and application parameter of the algorithm script in the script parameter in the character string, the different character locations may be filled with the script name, script version number, method name and application parameter in the character string corresponding to the parameters transmitted by the send method based on the character locations, or the identification information corresponding to the script name, script version number, method name and application parameter may be obtained respectively, the character string corresponding to the parameters transmitted by the send method may be generated based on the identification information, script name, script version number, method name and application parameter, for example, the start of the character string is any identification information, and the identification information is followed by the corresponding parameters, that is, the character string is any combination of the identification information corresponding to the script name and the script name, the identification information corresponding to the script version number and the script version number, the identification information corresponding to the method name and the method name, and the identification information corresponding to the application parameter and the application parameter.
In the call request, the Content-Type format is a preset message body data format, for example, the preset message body data format is an application/json format, so as to ensure that each application can send the call request by using the preset message body data format, and the algorithm container can analyze the call request according to the preset message body data format, so as to obtain information such as script information and script parameters in the message body.
In this embodiment, when a call request is received, it is determined whether the call request meets a preset condition based on a public routing address, that is, it is determined whether a URL of the call request is a public routing address.
Step S200, if the calling request meets the preset condition, inquiring a corresponding algorithm script in an algorithm database based on the calling request;
in this embodiment, when the call request meets the preset condition, the algorithm container queries the algorithm script corresponding to the call request in the algorithm database, and specifically, the algorithm container obtains script information corresponding to the call request by using a request.
Step S300, the algorithm script is operated based on the calling request so as to obtain an operation result corresponding to the calling request.
In this embodiment, when the algorithm script is queried, the algorithm container runs the algorithm script based on the call request and feeds back a running result to the application, specifically, the algorithm container obtains a script parameter corresponding to the call request by using a request.
It should be noted that, when the operation result is obtained, the algorithm container feeds back the operation result to the application or the application end to complete a complete algorithm script call.
Referring to fig. 3, fig. 3 is a schematic view of an application scenario in an embodiment of the script calling method of the present invention, in fig. 3, both an application a and an application B may implement http Post request uniform URL based on a call request including a public routing address sent by a Post request, and an algorithm container queries a corresponding algorithm script (model algorithm) in an algorithm Database (algorithm model storage medium and algorithm Database) according to the call request.
In the script calling method provided by the embodiment, when a calling request is received, whether the calling request meets a preset condition is determined based on a public routing address; then if the calling request meets the preset condition, inquiring a corresponding algorithm script in an algorithm database based on the calling request; and then the algorithm script is operated based on the calling request, the operation result is fed back to the application, the algorithm script corresponding to the algorithm container is called through the public routing address, the calling of different algorithm scripts can be realized through the public routing address, different routing URL path rules do not need to be set for different algorithm scripts, the development cost and the access threshold are further reduced, and the algorithm script access convenience is improved.
Based on the first embodiment, a second embodiment of the script calling method of the present invention is proposed, in this embodiment, step S100 includes:
step S110, obtaining a Uniform Resource Locator (URL) corresponding to the calling request;
step S120, determining whether the URL is matched with the public routing address, wherein if the URL is matched with the public routing address, the calling request is determined to meet a preset condition.
In this embodiment, to ensure that an algorithm script can be accurately called through an algorithm container, when a call request is received, a uniform resource locator URL corresponding to the call request is obtained, specifically, the call request includes the URL and a parameter transmitted by the call request, the call request is analyzed to obtain the URL, and then it is determined whether the URL matches the public routing address, that is, it is determined whether the URL is consistent with the public routing address, where if the URL matches the public routing address, it is determined that the call request satisfies a preset condition.
According to the script calling method provided by the embodiment, the URL corresponding to the calling request is obtained, and then whether the URL is matched with the public routing address or not is determined, wherein if the URL is matched with the public routing address, it is determined that the calling request meets the preset condition, and the accuracy and the efficiency of calling the algorithm script by the algorithm container are improved by judging whether the URL is matched with the public routing address or not.
Based on the first embodiment, a third embodiment of the script calling method of the present invention is provided, in this embodiment, step S100 includes:
step S130, when receiving a call request, determining whether the call request is a Post request;
step S140, if the calling request is a Post request, determining whether the calling request meets a preset condition based on a public routing address.
In this embodiment, the system may receive a call request sent by an application that is not provided with a public routing address and a preset message body data format, or receive a call request sent by an application that is not provided with a public routing address and a preset message body data format, and the call request sent by the application or the application that is provided with a public routing address and a preset message body data format is a GET request, so when receiving the call request, it is determined whether the call request is a Post request, specifically, whether the call request is a Post request is determined according to whether a data format corresponding to the call request matches a data format corresponding to the Post request, and then, if the call request is a Post request, it is determined whether the call request satisfies a preset condition based on the public routing address.
In the script calling method provided by this embodiment, when a calling request is received, it is determined whether the calling request is a Post request; and then if the calling request is a Post request, determining whether the calling request meets a preset condition based on a public routing address, and further improving the accuracy and efficiency of calling the algorithm script by the algorithm container.
Based on the first embodiment, a fourth embodiment of the script invoking method of the present invention is proposed, in this embodiment, step S200 includes:
step S210, acquiring a preset message body data format;
step S220, querying the algorithm script in an algorithm database based on the preset message body data format and the call request.
It should be noted that, a preset message body data format is set in advance at the system and the sender of the call request, the preset message body data format may include a script name and a script version number location information or a script name, a script version number, a method name and identification information corresponding to application parameters in a character string corresponding to parameters transmitted by the send method, different character locations may be set in the character string for the script name and the script version number of the algorithm script in the script information and the method name and the application parameters of the algorithm script in the script parameters, the script name, the script version number, the method name and the application parameters are filled in the character string corresponding to the parameters transmitted by the send method based on the character locations, or the script name, the script version number, the method name and the identification information corresponding to the application parameters are respectively obtained based on the identification information, the script name, the script version number, the method name and, The script version number, the method name and the application parameter generate a character string corresponding to the parameter transmitted by the send method, for example, the beginning of the character string is any identification information, and the identification information is the corresponding parameter, that is, the character string is any combination of the identification information and the script name corresponding to the script name, the identification information and the script version number corresponding to the script version number, the identification information and the method name corresponding to the method name, and the identification information and the application parameter corresponding to the application parameter.
In this embodiment, when the call request meets the preset condition, the algorithm container obtains a Content-Type format corresponding to the call request, and further obtains the preset message body data format, or the algorithm container obtains the preset message body data format according to the preset storage address.
Then, the algorithm container queries the algorithm script in an algorithm database based on the preset message body data format and the call request, specifically, the call request is analyzed according to the preset message body data format to obtain script information corresponding to the call request, and then the algorithm script is queried in the algorithm database according to the script information to accurately obtain the algorithm script corresponding to the call request.
Further, in an embodiment, step S220 includes:
step S221, analyzing the calling request based on the preset message body data format to obtain a script name and a script version number corresponding to the algorithm script;
step S222, based on the script name and the script version number, inquiring the algorithm script in an algorithm database.
In this embodiment, the algorithm container uses a request.form [ data ] method, analyzes the call request based on the preset message body data format, acquires script information corresponding to the call request, and further obtains a script name of an algorithm script and a script version number of the algorithm script in the script information, where the preset message body data format includes the script name and script version number position information in a character string corresponding to a parameter transmitted by the send method or identification information corresponding to the script name, the script version number, a method name and an application parameter, and the algorithm container can use the request.form [ data ] method to analyze the call request according to the preset message body data format, so as to obtain the script name and the script version number.
And then, according to the script name and the script version number, inquiring the algorithm script in the algorithm database, so that the inquired script name of the algorithm script is consistent with the script name in the script information, and the inquired script version number of the algorithm script is consistent with the script version number in the script information, thereby accurately obtaining the algorithm script corresponding to the call request and improving the call accuracy of the algorithm script.
Referring to fig. 4 and 5, fig. 4 is a schematic diagram of a preset message body data format (message body format) in an embodiment of the present invention, and fig. 5 is a schematic diagram of a data storage format in an algorithm database in an embodiment of the present invention, where "moduleName" is a name of an algorithm script, and "versionId" is a script version number of the algorithm script, and an algorithm container loads a corresponding algorithm script in the algorithm database through the moduleName + versionId.
The script calling method provided by the embodiment obtains a preset message body data format; then, based on the preset message body data format and the calling request, the algorithm script is inquired in the algorithm database, script information is accurately obtained according to the preset message body data format, the algorithm script corresponding to the calling request is further accurately inquired, the calling accuracy of the algorithm script is improved, then when the algorithm script corresponding to the algorithm container is called through the public routing address, accurate calling of different algorithm scripts can be achieved, different routing URL (uniform resource locator) path rules do not need to be set for different algorithm scripts, and the algorithm script access convenience is further improved.
Based on the first embodiment, a fifth embodiment of the script invoking method of the present invention is provided, in this embodiment, step S300 includes:
step S310, obtaining script parameters corresponding to the calling request;
step S320, running the algorithm script based on the script parameter to obtain a running result corresponding to the call request.
In this embodiment, when the algorithm script is queried, the algorithm container obtains a script parameter corresponding to the call request, specifically, the algorithm container obtains the script parameter corresponding to the call request by using a request. And then the algorithm script is operated based on the script parameters to obtain an operation result corresponding to the calling request.
Further, in an embodiment, step S310 includes:
analyzing the calling request based on a preset message body data format to obtain the script parameters, wherein the script parameters comprise a method name and application parameters of an algorithm script;
step S320 includes:
and transmitting the application parameters to the method corresponding to the method name in the algorithm script so as to run the algorithm script.
In this embodiment, the algorithm container obtains the script parameters corresponding to the call request by using a request.
Because the preset message body data format comprises the script name and the script version number position information or the identification information corresponding to the script name, the script version number, the method name and the application parameter in the character string corresponding to the parameter transmitted by the send method, the algorithm container can use a request.
Referring to fig. 4, in fig. 4, "methodName" is a method name that needs to call an algorithm script, a "param" field is used to pass through upper application parameters to the algorithm script, and when the algorithm script is loaded, an algorithm container passes through the param parameter field to the methodName method corresponding to the algorithm script.
In the script calling method provided by this embodiment, the script parameter corresponding to the calling request is obtained; and then, the algorithm script is operated based on the script parameters to obtain an operation result corresponding to the calling request, and the script parameters are accurately obtained according to a preset message body data format, so that the calling accuracy of the algorithm script is improved.
An embodiment of the present invention further provides a script invoking device, and with reference to fig. 6, the script invoking device includes:
a determining module 100, configured to determine, when a call request is received, whether the call request meets a preset condition based on a public routing address;
the query module 200 is configured to query a corresponding algorithm script in an algorithm database based on the call request if the call request meets a preset condition;
the running module 300 is configured to run the algorithm script based on the call request to obtain a running result corresponding to the call request.
Optionally, the determining module 100 is further configured to:
acquiring a Uniform Resource Locator (URL) corresponding to the calling request;
and determining whether the URL is matched with the public routing address, wherein if the URL is matched with the public routing address, the calling request is determined to meet a preset condition.
Optionally, the determining module 100 is further configured to:
when a call request is received, determining whether the call request is a Post request;
and if the calling request is a Post request, determining whether the calling request meets a preset condition based on a public routing address.
Optionally, the query module 200 is further configured to:
acquiring a preset message body data format;
and inquiring the algorithm script in an algorithm database based on the preset message body data format and the calling request.
Optionally, the query module 200 is further configured to:
analyzing the calling request based on the preset message body data format to obtain a script name and a script version number corresponding to the algorithm script;
and inquiring the algorithm script in an algorithm database based on the script name and the script version number.
Optionally, the operation module 300 is further configured to:
acquiring script parameters corresponding to the calling request;
and running the algorithm script based on the script parameters to obtain a running result corresponding to the calling request.
Optionally, the operation module 300 is further configured to:
analyzing the calling request based on a preset message body data format to obtain the script parameters, wherein the script parameters comprise a method name and application parameters of an algorithm script;
and transmitting the application parameters to the method corresponding to the method name in the algorithm script so as to run the algorithm script.
Optionally, the application acquires script information and script parameters, generates the call request based on the public routing address, the script information and the script parameters according to a preset message body data format, and sends the call request based on a Post request.
The methods executed by the program modules can refer to the embodiments of the script calling method of the present invention, and are not described herein again.
In addition, the embodiment of the invention also provides a computer readable storage medium.
The computer readable storage medium has stored thereon a script invocation program which, when executed by a processor, implements the steps of the script invocation method described above.
The method implemented when the script calling program running on the processor is executed may refer to each embodiment of the script calling method of the present invention, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A script calling method, characterized in that the script calling method comprises the following steps:
when a call request is received, determining whether the call request meets a preset condition based on a public routing address;
if the calling request meets a preset condition, inquiring a corresponding algorithm script in an algorithm database based on the calling request;
and running the algorithm script based on the calling request to obtain a running result corresponding to the calling request.
2. The script calling method of claim 1, wherein said step of determining whether said call request satisfies a preset condition based on a common routing address comprises:
acquiring a Uniform Resource Locator (URL) corresponding to the calling request;
and determining whether the URL is matched with the public routing address, wherein if the URL is matched with the public routing address, the calling request is determined to meet a preset condition.
3. The script calling method of claim 1, wherein said step of determining whether a call request satisfies a preset condition based on a common routing address upon receipt of said call request comprises:
when a call request is received, determining whether the call request is a Post request;
and if the calling request is a Post request, determining whether the calling request meets a preset condition based on a public routing address.
4. The script calling method according to claim 1, wherein said step of querying a corresponding algorithm script in an algorithm database based on said call request comprises:
acquiring a preset message body data format;
and inquiring the algorithm script in an algorithm database based on the preset message body data format and the calling request.
5. The script calling method according to claim 4, wherein said step of querying said algorithm script in an algorithm database based on said preset message body data format and said calling request comprises:
analyzing the calling request based on the preset message body data format to obtain a script name and a script version number corresponding to the algorithm script;
and inquiring the algorithm script in an algorithm database based on the script name and the script version number.
6. The script calling method according to claim 1, wherein said step of executing said algorithm script based on said calling request to obtain an execution result corresponding to said calling request comprises:
acquiring script parameters corresponding to the calling request;
and running the algorithm script based on the script parameters to obtain a running result corresponding to the calling request.
7. The script calling method according to claim 6, wherein said step of obtaining script parameters corresponding to said calling request comprises:
analyzing the calling request based on a preset message body data format to obtain the script parameters, wherein the script parameters comprise a method name and application parameters of an algorithm script;
the step of running the algorithm script based on the script parameters comprises:
and transmitting the application parameters to the method corresponding to the method name in the algorithm script so as to run the algorithm script.
8. The script calling method according to any one of claims 1 to 7, wherein said script calling method further comprises, before the step of determining whether the call request satisfies a preset condition based on a common routing address when the call request is received:
and the application acquires script information and script parameters, generates the call request based on the public routing address, the script information and the script parameters according to a preset message body data format, and sends the call request based on the Post request.
9. A script calling apparatus, wherein the script calling apparatus comprises:
the determining module is used for determining whether the calling request meets a preset condition or not based on the public routing address when the calling request is received;
the query module is used for querying a corresponding algorithm script in an algorithm database based on the call request if the call request meets a preset condition;
and the operation module is used for operating the algorithm script based on the calling request so as to obtain an operation result corresponding to the calling request.
10. A script calling device, characterized in that the script calling device comprises: memory, a processor and a script caller stored on the memory and executable on the processor, the script caller when executed by the processor implementing the steps of the script calling method of any one of claims 1 to 8.
11. A computer-readable storage medium, having stored thereon a script caller, which when executed by a processor implements the steps of the script calling method of any one of claims 1 to 8.
CN202010092511.6A 2020-02-12 2020-02-12 Script calling method, device, equipment and computer readable storage medium Pending CN111258685A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010092511.6A CN111258685A (en) 2020-02-12 2020-02-12 Script calling method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010092511.6A CN111258685A (en) 2020-02-12 2020-02-12 Script calling method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111258685A true CN111258685A (en) 2020-06-09

Family

ID=70951104

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010092511.6A Pending CN111258685A (en) 2020-02-12 2020-02-12 Script calling method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111258685A (en)

Similar Documents

Publication Publication Date Title
CN107515764B (en) Application page opening method, terminal and computer readable storage medium
CN107291497B (en) Multi-firmware upgrading method and system and readable storage medium
CN108401026B (en) Block chain-based data storage method, system and computer-readable storage medium
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN108170723B (en) Webpage resource acquisition method, terminal equipment, server and system
CN111324813A (en) Recommendation method, device, equipment and computer readable storage medium
CN114640727B (en) Protocol analysis method, device and computer readable storage medium
CN108763297B (en) Webpage resource processing method and device and mobile terminal
CN107992615B (en) Website recommendation method, server and terminal
CN107918509B (en) Software shortcut prompt setting method and device and readable storage medium
CN107707602B (en) Data communication processing terminal, method and computer readable storage medium
CN108572985B (en) Page display method and device
CN111258685A (en) Script calling method, device, equipment and computer readable storage medium
CN113672311A (en) Structure assignment method, assigner and computer-readable storage medium
CN111030848B (en) Automatic configuration method and device of electronic product and storage medium
CN110309454B (en) Interface display method, device, equipment and storage medium
CN115905742A (en) Data display method, device, equipment and storage medium
CN113037868A (en) Cross-border store login method, device, equipment and computer readable storage medium
CN108111602B (en) Data pushing method and device and computer readable storage medium
CN113918499B (en) Open interface generation method, network device and computer readable storage medium
CN115146117A (en) WeChat ecology-based identification method and device and computer-readable storage medium
CN114297035B (en) Production monitoring method, system, equipment and computer readable storage medium
CN110545231A (en) business communication method, equipment and computer readable storage medium
CN113986338B (en) Project package scanning method, system, equipment and computer readable storage medium
CN111954164B (en) Equipment network distribution method and device and computer readable 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