CN114025027A - Data transmission script running method and device, storage medium and electronic device - Google Patents

Data transmission script running method and device, storage medium and electronic device Download PDF

Info

Publication number
CN114025027A
CN114025027A CN202111289734.2A CN202111289734A CN114025027A CN 114025027 A CN114025027 A CN 114025027A CN 202111289734 A CN202111289734 A CN 202111289734A CN 114025027 A CN114025027 A CN 114025027A
Authority
CN
China
Prior art keywords
target
script
data transmission
data
grammar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111289734.2A
Other languages
Chinese (zh)
Other versions
CN114025027B (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.)
Sunwave Communications Co Ltd
Original Assignee
Zhejiang Sanwei Wanyilian Technology Co ltd
Sunwave Communications 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 Zhejiang Sanwei Wanyilian Technology Co ltd, Sunwave Communications Co Ltd filed Critical Zhejiang Sanwei Wanyilian Technology Co ltd
Priority to CN202111289734.2A priority Critical patent/CN114025027B/en
Publication of CN114025027A publication Critical patent/CN114025027A/en
Application granted granted Critical
Publication of CN114025027B publication Critical patent/CN114025027B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y10/00Economic sectors
    • G16Y10/75Information technology; Communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The embodiment of the invention provides a method, a device, a storage medium and an electronic device for running a data transmission script, wherein the method comprises the following steps: acquiring a target data transmission request of a target application, wherein the target data transmission request is used for requesting to transmit target data with target attributes for the target application; calling a target script template matched with the target attribute from a script template library, wherein the script template library is used for recording a plurality of pre-created reference script templates; generating a data transmission script corresponding to the target data transmission request through a target script template; and running the data transmission script. According to the invention, the problem of low efficiency of establishing the data transmission script for transmitting the data for the target application in the related technology is solved, and the effect of improving the efficiency of establishing the data transmission script for transmitting the data for the target application is further achieved.

Description

Data transmission script running method and device, storage medium and electronic device
Technical Field
The embodiment of the invention relates to the field of data management, in particular to a running method and device of a data transmission script, a storage medium and an electronic device.
Background
In recent years, with the rapid development of the technology of the internet of things, in order to meet the management requirements of the application of the internet of things and the equipment of the internet of things, the application platform of the internet of things is often used for managing the application of the internet of things and the equipment of the internet of things, the Internet of things platform can realize data transmission between Internet of things application and Internet of things equipment, but in the related art, when data management between Internet of things reference and Internet of things equipment is based on the Internet of things platform, application functions need to be customized and developed on the Internet of things platform, application data protocols need to be manually docked, managing data between the application and the internet of things device according to the manually created data protocol, when the accessed application or the function of the application is different, the application data protocol needs to be encoded again, therefore, the method can also repeatedly carry out manual programming operation of the data protocol and cannot adapt to the application requirements of flexible and variable services.
In view of the problem in the related art that the efficiency of creating a data transmission script for transmitting data for a target application is low, no effective solution has been proposed at present.
Disclosure of Invention
Embodiments of the present invention provide an operating method and apparatus for a data transmission script, a storage medium, and an electronic apparatus, so as to at least solve the problem in the related art that the efficiency of creating a data transmission script for transmitting data for a target application is low.
According to an embodiment of the present invention, there is provided a method for executing a data transfer script, including: acquiring a target data transmission request of a target application, wherein the target data transmission request is used for requesting to transmit target data with target attributes for the target application; calling a target script template matched with the target attribute from a script template library, wherein the script template library is used for recording a plurality of pre-created reference script templates; generating a data transmission script corresponding to the target data transmission request through the target script template, wherein an implementation code for transmitting the target data for the target application is recorded in the data transmission script; and running the data transmission script.
Optionally, the generating, by the target script template, the data transmission script corresponding to the target data transmission request includes: acquiring a target coding mode corresponding to the target data transmission request, wherein the target coding mode is used for indicating a coding rule of a code of the data transmission script for executing the target data transmission request; and editing the target script template through the target coding mode to obtain the data transmission script.
Optionally, the obtaining the target encoding manner corresponding to the target data transmission request includes: determining a syntactic structure corresponding to the target attribute from the data attribute and the syntactic structure with the corresponding relation to obtain a syntactic structure set, wherein the syntactic structure is used for indicating a target code of a target function; determining a target association relation among the syntactic structures included in the syntactic structure set in a target map, wherein the target map is used for storing the coded syntactic structures and the association relation among the syntactic structures in a map form; and determining the target coding mode according to the grammar structure set and the target incidence relation.
Optionally, determining the target encoding manner according to the syntax structure set and the target association relationship includes: determining a calling sequence of the grammar structures included in the grammar structure set, wherein the calling sequence accords with the target incidence relation; and determining the target coding mode as calling the grammar structures included in the grammar structure set according to the calling sequence.
Optionally, before determining a target association relationship between the grammar structures included in the grammar structure set in the target map, the method further includes obtaining a reference character stream, wherein the reference character stream includes a code for requesting transmission of reference data with reference attributes for the target application; identifying the reference character stream by using a preset grammar rule to obtain a reference grammar structure in the reference data transmission request and a reference incidence relation between the reference grammar structures; and constructing the target map according to the reference grammar structure and the reference incidence relation.
Optionally, after the target map is constructed according to the reference grammar structure and the reference association relationship, the method further includes: detecting whether a grammar structure corresponding to the reference character stream in the target map is in a called state or not under the condition that the change of the data in the reference character stream is detected; under the condition that the grammar structure corresponding to the reference character stream in the target map is detected to be in an un-called state, the reference character stream after being changed is identified and processed by using the preset grammar rule, and the reference incidence relation between the reference grammar structure after being changed and the reference grammar structure after being changed is obtained; constructing a reference map according to the incidence relation between the changed reference grammar structure and the changed reference grammar structure; and updating the target map by using the reference map to obtain the updated target map.
Optionally, the invoking the target script template matching the target attribute from a script template library includes: acquiring a template tag of the reference script template in the script template library, wherein the template tag is used for indicating the function information of the reference script template; calculating the matching degree of the target attribute and the template label of each reference script template; and determining the reference script template with the highest matching degree as the target script template.
According to another embodiment of the present invention, there is also provided a data transmission script execution apparatus, including: the device comprises a first acquisition module, a first storage module and a second acquisition module, wherein the first acquisition module is used for acquiring a target data transmission request of a target application, and the target data transmission request is used for requesting to transmit target data with target attributes for the target application; the calling module is used for calling a target script template matched with the target attribute from a script template library, wherein the script template library is used for recording a plurality of pre-created reference script templates; a generating module, configured to generate, through the target script template, a data transmission script corresponding to the target data transmission request, where an implementation code for transmitting the target data for the target application is recorded in the data transmission script; and the running module is used for running the data transmission script.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, a target data transmission request of a target application is obtained, wherein the target data transmission request is used for requesting the target application to transmit target data with target attributes; calling a target script template matched with the target attribute from a script template library, wherein the script template library is used for recording a plurality of pre-created reference script templates; generating a data transmission script corresponding to the target data transmission request through a target script template, wherein a realization code for transmitting target data for the target application is recorded in the data transmission script; the data transmission script is run, namely a reference script template is created in advance, the implementation code of the data transmission script for executing the corresponding data transmission request can be generated through the reference script template, when the attributes of the data requested to be transmitted for the target application are different, the used reference script template is also different, when the target data transmission request for requesting to transmit the target data with the target attributes for the target application is obtained, the target script template matched with the target attributes can be selected according to the target attributes of the target data requested to be transmitted, and then the implementation code of the corresponding data transmission script is generated according to the target script template, the requirement of transmitting the target data with the target attributes for the target application can be realized when the generated data transmission script is run, and the complex operation of manually creating the data transmission script for executing the data transmission request for the target application is avoided, therefore, the problem that the efficiency of creating the data transmission script for transmitting the data for the target application is low in the related art is solved, and the effect of improving the efficiency of creating the data transmission script for transmitting the data for the target application is achieved.
Drawings
Fig. 1 is a block diagram of a hardware structure of a mobile terminal of a method for executing a data transmission script according to an embodiment of the present invention;
FIG. 2 is a flow diagram of a method of operation of a data transmission script according to an embodiment of the invention;
FIG. 3 is a diagram of an alternative data processing system in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative data processing procedure according to an embodiment of the invention;
FIG. 5 is an alternative data transmission flow diagram according to an embodiment of the present application;
fig. 6 is a block diagram of a configuration of an apparatus for executing a data transmission script according to an embodiment of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the example of running on a mobile terminal, fig. 1 is a block diagram of a hardware structure of the mobile terminal of the running method of the data transmission script according to the embodiment of the present invention. As shown in fig. 1, the mobile terminal may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the execution method of the data transmission script in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by executing the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for running a data transmission script is provided, and fig. 2 is a flowchart of a method for running a data transmission script according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, obtaining a target data transmission request of a target application, wherein the target data transmission request is used for requesting to transmit target data with target attributes for the target application;
step S204, a target script template matched with the target attribute is called from a script template library, wherein the script template library is used for recording a plurality of pre-created reference script templates;
step S206, generating a data transmission script corresponding to the target data transmission request through the target script template, wherein the data transmission script records an implementation code for transmitting the target data for the target application
And step S208, operating the data transmission script.
Through the steps, the reference script template is created in advance, the implementation code of the data transmission script for executing the corresponding data transmission request can be generated through the reference script template, when the attributes of the data requested to be transmitted for the target application are different, the used reference script template is also different, when the target data transmission request for requesting to transmit the target data with the target attributes for the target application is obtained, the target script template matched with the target attributes can be selected according to the target attributes of the target data requested to be transmitted, and then the implementation code of the corresponding data transmission script is generated according to the target script template, the requirement of transmitting the target data with the target attributes for the target application can be realized when the generated data transmission script is operated, and the complex operation of manually creating the data transmission script for executing the data transmission request for the target application is avoided, therefore, the problem that the efficiency of creating the data transmission script for transmitting the data for the target application is low in the related art is solved, and the effect of improving the efficiency of creating the data transmission script for transmitting the data for the target application is achieved.
In the technical solution provided in step S202, the target application is an application for managing internet of things devices, for example, the target application may be an application for managing home appliances.
Optionally, in this embodiment, the target data transmission request may be in the form of an identification signal corresponding to the request, or may be in the form of a segment of a statement for describing the request to transmit the target data with the target attribute, or may be in the form of a character stream for describing the target data with the target attribute, for example, when the operator registers the target application, and selects an attribute of the data to be transmitted for the application on the registration page, the target transmission request in the form of a signal can be generated according to the attribute back end selected in the previous segment, or may be in the form of a statement for describing the attribute of the data to be transmitted (for example, a certain application needs data with a certain attribute), or may be in the form of a character stream for describing the attribute of the data to be transmitted.
Alternatively, in the present embodiment, the target data transmission request may be determined, but not limited to, according to a functional attribute of the application, an application scenario of the application, a linkage rule of a plurality of application scenarios of the application, and the like. For example, the target data transmission request determined according to the function attribute of the application may be a target data transmission request requesting to acquire operation data of an air-conditioning device of a certain model, which is generated according to the function attribute of the selected target application, because the function attribute of the target application (for example, used for managing the air-conditioning device of the certain model) needs to be checked out on a registration page when an operator registers the target application to the application management platform of the internet of things; the target data transmission request determined according to the application scenario of the application may be that when an operator registers a target application to the internet of things application management platform, an application scenario of the target application is set on a registration page (for example, operation data of air-conditioning equipment of a certain model is acquired once at 8 am every day), so that the operation data of the air-conditioning equipment of the certain model can be generated according to the set application scenario and requested to be acquired at 8 am; the target data transmission request according to the linkage rule of the applied multiple application scenes may be a linkage rule between the multiple application scenes of the target application set on the registration page by an operator when the registration target is applied to the internet of things application management platform (for example, when the operating parameter of the air-conditioning equipment reaches a certain value, the air-conditioning equipment is turned off, the linkage scene comprises two application scenes, one is used for detecting the operating parameter of the air-conditioning equipment, the other is used for turning off the air-conditioning equipment when the operating parameter of the air-conditioning equipment is higher than the certain value), so that two target data transmission requests are generated according to the set linkage rule of the application scenes, namely, the target data transmission request for obtaining the operating parameter of the air-conditioning equipment and the target data transmission request for transmitting the turn-off instruction to the air-conditioning equipment, and the two data transmission requests have a sequential relationship in the linkage rule between the application scenes, the method comprises the steps of firstly operating a target data transmission request for acquiring operation parameters, and when the parameters are detected to reach a certain value, operating the target data transmission request for transmitting a closing instruction to the air conditioning equipment.
Optionally, in this embodiment, the target attribute is used to indicate data information that needs to be transmitted, and the target attribute may include, but is not limited to, a type of data, information of a transmission object (a name or an identifier of a target application, a name or an identifier of a device corresponding to the target application), a size of the data, and the like.
Optionally, in this embodiment, the target data transmitted for the target application may be data that is sent by the target application, or may be data that is sent to the target application, and this is not limited in this scheme. In the technical solution provided in step S204 above, the reference script template is a script template storing general codes for executing some kind of data transmission request.
Optionally, in this embodiment, a corresponding relationship exists between the reference script template in the script template library and the attribute of the data to be transmitted, and the reference script templates that need to be used are different if the transmitted data attributes are different.
In the technical solution provided in step S206, the method for generating the data transmission script through the target script template may insert the data corresponding to the target attribute of the target data to be transmitted into the target script template to obtain the data transmission script, or may change the encoding format and the syntax structure of the target script template by using the encoding mode corresponding to the target attribute to obtain the data transmission script, which is not limited in this solution.
In the technical solution provided in step S208, the data transmission script may be run on an internet of things application management platform that manages the target application and the internet of things device, or may be run on a terminal device that is installed with the target application or the internet of things device, which is not limited in this solution.
Fig. 3 is a diagram of an alternative data processing system according to an embodiment of the present invention, applied to data processing between an application of the internet of things and a device of the internet of things, as shown in fig. 3, where the processing may include, but is not limited to, the following operations: an operator creates a target application on a WEB, performs object definition on the target application, such as defining a functional attribute of the target application, defining an application instance (a specific application scene) of the target application, linkage rules (multiple instances are used in combination) of the application instance, and the like, generates a data transmission request of the target application by defining the object of the target application, sends the data transmission request to an internet of things application management platform, requests the management platform to execute a command corresponding to the data transmission request, and acquires an execution result returned by the internet of things application management platform to execute the data transmission request; the Internet of things application management platform is connected with Internet of things equipment of various types, third-party service objects (such as companies or enterprises for managing application), business systems and the like; management of application examples of the created target application, management of objects of the internet of things, analysis of dependency relationships among the application examples and between the application examples and the equipment of the internet of things can be achieved on the application management platform of the internet of things, so that required data can be found out from data of the equipment of the internet of things according to the generated data transmission request, the found data are sent to the target application, the third-party service object and the corresponding business system, or the data generated by the target application can be sent to the equipment of the internet of things, the third-party service object and the business system which are connected under the management platform of the internet of things.
Fig. 4 is a schematic diagram of an optional data processing process according to an embodiment of the present invention, applied to data processing between an application of the internet of things and a device of the internet of things, as shown in fig. 4, where the processing may include, but is not limited to, the following steps:
s401, a script template library is created on an application management platform of the Internet of things, a plurality of pre-created reference script templates are stored in the script template library, general codes for executing data transmission requests are recorded in the reference script templates, different reference script templates can be used for executing different data transmission requests, and when a user registers a target application on a WEB terminal, corresponding options are selected on the WEB page, so that the target application is defined;
s402, after the target application is defined on the WEB page, instance creation is required to be carried out according to an application instance of the target application, so that an actual use scene of the target application is created, for example, operation data of certain type of Internet of things equipment is acquired;
s403, after the target application and the application instance of the target application are defined on the application platform of the Internet of things, the binding relationship between the instance and the equipment of the Internet of things can be constructed according to the created application instance and the application definition;
s404, a script template library is created in a storage position in advance, a plurality of pre-created reference script templates are stored in the script template library, general codes for executing data transmission requests are recorded in the reference script templates, and different reference script templates can be used for executing different data transmission requests;
s405, the Internet of things application management platform is connected with Internet of things application equipment of various types, and can acquire running data of the Internet of things equipment, generate a target data transmission request according to application definition and created examples of target application, match a corresponding reference script template in a script template library according to the target data transmission request, modify the reference script template according to the target data transmission request, obtain a data transmission script for executing the data transmission request, further realize message routing corresponding to the data transmission request between the target application and the Internet of things equipment according to the data transmission script, and also realize linkage rules among multiple examples of the target application and data processing of the Internet of things application;
s406, a plurality of Internet of things devices are connected under the Internet of things application platform, and the operation data of the Internet of things devices are transmitted to the Internet of things application platform.
As an optional example, the generating of the data transmission script corresponding to the target data transmission request by the target script template includes:
acquiring a target coding mode corresponding to the target data transmission request, wherein the target coding mode is used for indicating a coding rule of a code of the data transmission script for executing the target data transmission request;
and editing the target script template through the target coding mode to obtain the data transmission script.
Optionally, in this embodiment, the obtaining of the target encoding mode may be determined in the data transmission request and the encoding mode having the corresponding relationship, may also be generated according to the target data transmission request, and may also be sent by other devices after querying related data according to the target data transmission request to obtain the target encoding mode, which is not limited in this embodiment.
Optionally, in this embodiment, the encoding rule is used to indicate a domain-specific language format to which the target data transmission request belongs, for example, a usage of a specific character, an association relationship of the character, a sequence of the character, and the like, which is not limited in this embodiment.
Optionally, in this embodiment, the target encoding manner may include, but is not limited to, one or more encoding rules.
As an optional example, the obtaining the target encoding manner corresponding to the target data transmission request includes:
determining a syntactic structure corresponding to the target attribute from the data attribute and the syntactic structure with the corresponding relation to obtain a syntactic structure set, wherein the syntactic structure is used for indicating a target code of a target function;
determining a target association relation among the syntactic structures included in the syntactic structure set in a target map, wherein the target map is used for storing the coded syntactic structures and the association relation among the syntactic structures in a map form;
and determining the target coding mode according to the grammar structure set and the target incidence relation.
Optionally, in this embodiment, the syntax structure is object code composed of specific characters and having a specific meaning in a domain to which the target data transmission request belongs, and the syntax structure may include, but is not limited to, modifiers, operators, interfaces, return values, code comments, and the like, which is not limited by this embodiment.
Optionally, in this embodiment, the target association relationship is used to indicate a usage relationship between syntax structures, such as a call sequence of a syntax structure in a specific scenario, or other syntax structures that need to be called together to be used with a certain syntax structure when the syntax structure is called.
Optionally, in this embodiment, the object code may include, but is not limited to, characters, numbers, a combination of characters or numbers, and the like, which is not limited in this embodiment.
Optionally, in this embodiment, the target map is a representation of a map used to describe Syntax of the program code, where the map has a plurality of nodes with associated relationships, each node represents a Syntax structure (such as a modifier, an operator, an interface, a return value, a code comment, and the like), and the target map may include, but is not limited to, an AST (Abstract Syntax Tree) map, a CST (Concrete Syntax Tree) map, and the like, which is not limited in this embodiment.
As an optional example, determining the target encoding manner according to the syntax structure set and the target association relationship includes:
determining a calling sequence of the grammar structures included in the grammar structure set, wherein the calling sequence accords with the target incidence relation;
and determining the target coding mode as calling the grammar structures included in the grammar structure set according to the calling sequence.
Optionally, in this embodiment, determining the calling order of the syntax structures in the syntax structure set may be determining the sequence of the queried syntax structures as the calling order of the syntax structures by a method of querying in the target map according to the syntax structures.
As an optional example, before determining the target association relationship between the grammar structures included in the grammar structure set in the target map, the method further includes:
acquiring a reference character stream, wherein the reference character stream comprises a code for requesting to transmit reference data with reference attributes for the target application;
identifying the reference character stream by using a preset grammar rule to obtain a reference grammar structure in the reference data transmission request and a reference incidence relation between the reference grammar structures;
and constructing the target map according to the reference grammar structure and the reference incidence relation.
Alternatively, in this embodiment, the reference character stream may be a preset character stream containing codes for requesting to transmit data of a certain attribute for the target application (a request corresponding to a defined target application function, a request corresponding to an application scenario of the target application having an interlocking relationship, and the like), for example, codes corresponding to various data transmission requests are preset, and these codes are used as the reference character stream.
Optionally, in this embodiment, the preset grammar rule is a set storing a specific language structure and a language rule, and the reference association relationship between the reference grammar structure and the reference grammar structure is obtained by performing language recognition on the reference character stream using the preset grammar rule, for example, a rule engine grammar is defined based on Antlr, and the association relationship between the language structure and the language structure in the specific language format in the reference character stream is determined by the rule engine grammar.
Optionally, in this embodiment, the target maps generated by different reference character streams may be stored in the same map, or may be stored in different maps, which is not limited in this embodiment.
As an optional example, after the target map is constructed according to the reference grammar structure and the reference incidence relation, the method further includes:
detecting whether a grammar structure corresponding to the reference character stream in the target map is in a called state or not under the condition that the change of the data in the reference character stream is detected;
under the condition that the grammar structure corresponding to the reference character stream in the target map is detected to be in an un-called state, the reference character stream after being changed is identified and processed by using the preset grammar rule, and the reference incidence relation between the reference grammar structure after being changed and the reference grammar structure after being changed is obtained;
constructing a reference map according to the incidence relation between the changed reference grammar structure and the changed reference grammar structure;
and updating the target map by using the reference map to obtain the updated target map.
Optionally, in this embodiment, the change of the data in the reference character stream may be a change of data used for indicating a numerical value, a change of a type of transmitted data, or a change of a transmission object and a reception object of the transmitted data, which is not limited in this embodiment.
Optionally, in this embodiment, detecting whether the grammar structure corresponding to the reference character stream is in the called state may be by detecting whether the corresponding grammar structure is running, or by detecting whether the corresponding script template is in the edited state, which is not limited in this scheme.
As an optional example, the calling the target script template matching the target attribute from a script template library comprises:
acquiring a template tag of the reference script template in the script template library, wherein the template tag is used for indicating the function information of the reference script template;
calculating the matching degree of the target attribute and the template label of each reference script template;
and determining the reference script template with the highest matching degree as the target script template.
Optionally, in this embodiment, the template tags may set weights, and the matching degree is obtained by performing weighting calculation on the matched template tags, and the weight values of different template tags may set the same weight value or different weight values, which is not limited in this embodiment.
Optionally, in this embodiment, the matching degree may be determined according to the number of matched template tags, and the greater the number of matched template tags, the greater the matching degree.
Fig. 5 is an optional data transmission flowchart according to an embodiment of the present application, which is applied to the application management platform of the internet of things in fig. 3 and 4, as shown in fig. 5, the foregoing process may include, but is not limited to, the following steps:
s501, the Internet of things application management platform acquires a data transmission request of a target application;
s502, a script template library is created in advance, a plurality of pre-created reference script templates are stored in the script template library, general codes for executing data transmission requests are recorded in the reference script templates, different reference script templates can be used for executing different data transmission requests, and matched reference script templates can be determined in the script template library according to the data transmission requests;
s503, modifying the reference script template according to the data transmission request to obtain a data transmission script, and transmitting data corresponding to the data transmission request by using the data transmission script;
s504, a plurality of Internet of things devices are connected under the Internet of things application management platform, and the Internet of things devices can transmit device data to the Internet of things application management platform in real time;
s505, selecting data matched with the data transmission request from the equipment data by the Internet of things application management platform;
s506, the rule executor executes the data transmission script, forwards the data through the data transmission script, can directly send the data to be forwarded to the forwarding module, and can also execute the step S507;
s507, a triggering time condition is set in the timing triggering module, and the data is triggered to be sent to the forwarding module only when the time condition is met;
and S508, the forwarding module sends the target data to be transmitted to corresponding applications, equipment, memories and the like through the data transmission script.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions 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) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, there is further provided an apparatus for executing a data transmission script, and fig. 6 is a block diagram of an apparatus for executing a data transmission script according to an embodiment of the present invention, as shown in fig. 6, the apparatus includes:
a first obtaining module 62, configured to obtain a target data transmission request of a target application, where the target data transmission request is used to request transmission of target data with a target attribute for the target application;
a calling module 64, configured to call a target script template matching the target attribute from a script template library, where the script template library is used to record multiple pre-created reference script templates;
a generating module 66, configured to generate, through the target script template, a data transmission script corresponding to the target data transmission request, where an implementation code for transmitting the target data for the target application is recorded in the data transmission script;
an execution module 68 configured to execute the data transmission script.
Optionally, the generating module includes: an obtaining unit, configured to obtain a target encoding mode corresponding to the target data transmission request, where the target encoding mode is used to indicate an encoding rule of a code of the data transmission script that executes the target data transmission request; and the editing unit is used for editing the target script template through the target coding mode to obtain the data transmission script.
Optionally, the obtaining unit is configured to: determining a syntactic structure corresponding to the target attribute from the data attribute and the syntactic structure with the corresponding relation to obtain a syntactic structure set, wherein the syntactic structure is used for indicating a target code of a target function; determining a target association relation among the syntactic structures included in the syntactic structure set in a target map, wherein the target map is used for storing the coded syntactic structures and the association relation among the syntactic structures in a map form; and determining the target coding mode according to the grammar structure set and the target incidence relation.
Optionally, the obtaining unit is configured to: determining a calling sequence of the grammar structures included in the grammar structure set, wherein the calling sequence accords with the target incidence relation; and determining the target coding mode as calling the grammar structures included in the grammar structure set according to the calling sequence.
Optionally, the apparatus further includes a second obtaining module, configured to obtain a reference character stream before determining a target association relationship between the syntax structures included in the syntax structure set in a target map, where the reference character stream includes a code for requesting transmission of reference data with reference attributes for the target application; the identification module is used for identifying the reference character stream by using a preset grammar rule to obtain a reference grammar structure in the reference data transmission request and a reference incidence relation between the reference grammar structures; and the first construction module is used for constructing the target map according to the reference grammar structure and the reference incidence relation.
Optionally, the apparatus further comprises: the detection module is used for detecting whether a grammar structure corresponding to the reference character stream in the target map is in a called state or not under the condition that the change of data in the reference character stream is detected after the target map is constructed according to the reference grammar structure and the reference incidence relation; the processing module is used for identifying and processing the changed reference character stream by using the preset grammar rule under the condition that the grammar structure corresponding to the reference character stream in the target map is detected to be in an un-called state, so as to obtain the reference association relation between the changed reference grammar structure and the changed reference grammar structure; the second construction module is used for constructing a reference map according to the incidence relation between the changed reference grammar structure and the changed reference grammar structure; and the updating module is used for updating the target map by using the reference map to obtain the updated target map.
Optionally, the invoking module includes: an obtaining unit, configured to obtain a template tag of the reference script template in the script template library, where the template tag is used to indicate function information of the reference script template; a calculating unit, configured to calculate a matching degree between the target attribute and the template tag of each reference script template; and the determining unit is used for determining the reference script template with the highest matching degree as the target script template.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for executing a data transfer script, comprising:
acquiring a target data transmission request of a target application, wherein the target data transmission request is used for requesting to transmit target data with target attributes for the target application;
calling a target script template matched with the target attribute from a script template library, wherein the script template library is used for recording a plurality of pre-created reference script templates;
generating a data transmission script corresponding to the target data transmission request through the target script template, wherein an implementation code for transmitting the target data for the target application is recorded in the data transmission script;
and running the data transmission script.
2. The method of claim 1, wherein generating the data transfer script corresponding to the target data transfer request via the target script template comprises:
acquiring a target coding mode corresponding to the target data transmission request, wherein the target coding mode is used for indicating a coding rule of a code of the data transmission script for executing the target data transmission request;
and editing the target script template through the target coding mode to obtain the data transmission script.
3. The method of claim 2, wherein obtaining the target encoding scheme corresponding to the target data transmission request comprises:
determining a syntactic structure corresponding to the target attribute from the data attribute and the syntactic structure with the corresponding relation to obtain a syntactic structure set, wherein the syntactic structure is used for indicating a target code of a target function;
determining a target association relation among the syntactic structures included in the syntactic structure set in a target map, wherein the target map is used for storing the coded syntactic structures and the association relation among the syntactic structures in a map form;
and determining the target coding mode according to the grammar structure set and the target incidence relation.
4. The method of claim 3, wherein determining the target encoding mode according to the set of syntax structures and the target association comprises:
determining a calling sequence of the grammar structures included in the grammar structure set, wherein the calling sequence accords with the target incidence relation;
and determining the target coding mode as calling the grammar structures included in the grammar structure set according to the calling sequence.
5. The method of claim 3, wherein prior to determining the target associations between the grammar structures included in the set of grammar structures in the target graph, the method further comprises:
acquiring a reference character stream, wherein the reference character stream comprises a code for requesting to transmit reference data with reference attributes for the target application;
identifying the reference character stream by using a preset grammar rule to obtain a reference grammar structure in the reference data transmission request and a reference incidence relation between the reference grammar structures;
and constructing the target map according to the reference grammar structure and the reference incidence relation.
6. The method of claim 5, wherein after constructing the target graph according to the reference grammar structure and the reference incidence relation, the method further comprises:
detecting whether a grammar structure corresponding to the reference character stream in the target map is in a called state or not under the condition that the change of the data in the reference character stream is detected;
under the condition that the grammar structure corresponding to the reference character stream in the target map is detected to be in an un-called state, the reference character stream after being changed is identified and processed by using the preset grammar rule, and the reference incidence relation between the reference grammar structure after being changed and the reference grammar structure after being changed is obtained;
constructing a reference map according to the incidence relation between the changed reference grammar structure and the changed reference grammar structure;
and updating the target map by using the reference map to obtain the updated target map.
7. The method of claim 1, wherein invoking the target script template matching the target attribute from a script template library comprises:
acquiring a template tag of the reference script template in the script template library, wherein the template tag is used for indicating the function information of the reference script template;
calculating the matching degree of the target attribute and the template label of each reference script template;
and determining the reference script template with the highest matching degree as the target script template.
8. An apparatus for executing a data transfer script, comprising:
the device comprises a first acquisition module, a first storage module and a second acquisition module, wherein the first acquisition module is used for acquiring a target data transmission request of a target application, and the target data transmission request is used for requesting to transmit target data with target attributes for the target application;
the calling module is used for calling a target script template matched with the target attribute from a script template library, wherein the script template library is used for recording a plurality of pre-created reference script templates;
a generating module, configured to generate, through the target script template, a data transmission script corresponding to the target data transmission request, where an implementation code for transmitting the target data for the target application is recorded in the data transmission script;
and the running module is used for running the data transmission script.
9. A computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method as claimed in any of claims 1 to 7 are implemented when the computer program is executed by the processor.
CN202111289734.2A 2021-11-02 2021-11-02 Method and device for running data transmission script, storage medium and electronic device Active CN114025027B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111289734.2A CN114025027B (en) 2021-11-02 2021-11-02 Method and device for running data transmission script, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111289734.2A CN114025027B (en) 2021-11-02 2021-11-02 Method and device for running data transmission script, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN114025027A true CN114025027A (en) 2022-02-08
CN114025027B CN114025027B (en) 2023-10-03

Family

ID=80059841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111289734.2A Active CN114025027B (en) 2021-11-02 2021-11-02 Method and device for running data transmission script, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN114025027B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115756443A (en) * 2022-12-02 2023-03-07 中电金信软件有限公司 Script generation method and device, electronic equipment and readable storage medium
TWI809861B (en) * 2022-05-10 2023-07-21 新漢股份有限公司 Depolyment system for internet of things and deployment method for the same

Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030037326A1 (en) * 2001-08-06 2003-02-20 Ryan Burkhardt Method and system for installing staged programs on a destination computer using a reference system image
US20050004777A1 (en) * 2003-02-07 2005-01-06 Arm Limited Generation of a testbench for a representation of a device
CN1816043A (en) * 2005-02-06 2006-08-09 华为技术有限公司 Script generating device based on assembly multiplexing, and method therefor
CN101364891A (en) * 2007-08-10 2009-02-11 中兴通讯股份有限公司 System for collecting performance data by single point in distributed telecommunication network management and implementing method
US20160226976A1 (en) * 2015-01-29 2016-08-04 Quantum Metric, LLC Techniques for compact data storage of network traffic and efficient search thereof
CN106227784A (en) * 2016-07-19 2016-12-14 南京坦道信息科技有限公司 A kind of self-service peek system based on complete self-defined SQL scene
CN108763066A (en) * 2018-05-15 2018-11-06 南京璇玑信息技术有限公司 A kind of natural language test script edit methods of word slot design and test machine people
WO2019019766A1 (en) * 2017-07-25 2019-01-31 平安科技(深圳)有限公司 Data processing method and device, storage medium, and computer apparatus
CN109542412A (en) * 2018-10-16 2019-03-29 平安普惠企业管理有限公司 Interface message generation method, device, computer equipment and storage medium
CN110347598A (en) * 2019-07-10 2019-10-18 上海达梦数据库有限公司 A kind of test script generation method, device, server and storage medium
CN111221518A (en) * 2019-11-08 2020-06-02 深圳市彬讯科技有限公司 Script generation method, device, equipment and computer storage medium
CN111221525A (en) * 2020-01-09 2020-06-02 北京金山安全软件有限公司 Script code generation method and device, electronic equipment and storage medium
CN111475403A (en) * 2020-03-18 2020-07-31 中国平安人寿保险股份有限公司 Dynamic generation method of test script and related device
CN112052008A (en) * 2020-09-10 2020-12-08 腾讯科技(深圳)有限公司 Code checking method, device, computer equipment and computer readable storage medium
CN112083919A (en) * 2020-08-27 2020-12-15 远光软件股份有限公司 YAML template-based target service code generation method and device
CN112433699A (en) * 2020-11-05 2021-03-02 北京中电华大电子设计有限责任公司 Script engine for SE personalization
CN112564901A (en) * 2020-12-08 2021-03-26 浙江三维万易联科技有限公司 Key generation method and system, storage medium and electronic device
CN112948275A (en) * 2021-04-27 2021-06-11 平安普惠企业管理有限公司 Test data generation method, device, equipment and storage medium
CN113221525A (en) * 2021-02-26 2021-08-06 平安普惠企业管理有限公司 Data processing method and device, electronic equipment and storage medium
CN113342842A (en) * 2021-06-10 2021-09-03 南方电网数字电网研究院有限公司 Semantic query method and device based on metering knowledge and computer equipment

Patent Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030037326A1 (en) * 2001-08-06 2003-02-20 Ryan Burkhardt Method and system for installing staged programs on a destination computer using a reference system image
US20050004777A1 (en) * 2003-02-07 2005-01-06 Arm Limited Generation of a testbench for a representation of a device
CN1816043A (en) * 2005-02-06 2006-08-09 华为技术有限公司 Script generating device based on assembly multiplexing, and method therefor
CN101364891A (en) * 2007-08-10 2009-02-11 中兴通讯股份有限公司 System for collecting performance data by single point in distributed telecommunication network management and implementing method
US20160226976A1 (en) * 2015-01-29 2016-08-04 Quantum Metric, LLC Techniques for compact data storage of network traffic and efficient search thereof
CN106227784A (en) * 2016-07-19 2016-12-14 南京坦道信息科技有限公司 A kind of self-service peek system based on complete self-defined SQL scene
WO2019019766A1 (en) * 2017-07-25 2019-01-31 平安科技(深圳)有限公司 Data processing method and device, storage medium, and computer apparatus
CN108763066A (en) * 2018-05-15 2018-11-06 南京璇玑信息技术有限公司 A kind of natural language test script edit methods of word slot design and test machine people
CN109542412A (en) * 2018-10-16 2019-03-29 平安普惠企业管理有限公司 Interface message generation method, device, computer equipment and storage medium
CN110347598A (en) * 2019-07-10 2019-10-18 上海达梦数据库有限公司 A kind of test script generation method, device, server and storage medium
CN111221518A (en) * 2019-11-08 2020-06-02 深圳市彬讯科技有限公司 Script generation method, device, equipment and computer storage medium
CN111221525A (en) * 2020-01-09 2020-06-02 北京金山安全软件有限公司 Script code generation method and device, electronic equipment and storage medium
CN111475403A (en) * 2020-03-18 2020-07-31 中国平安人寿保险股份有限公司 Dynamic generation method of test script and related device
CN112083919A (en) * 2020-08-27 2020-12-15 远光软件股份有限公司 YAML template-based target service code generation method and device
CN112052008A (en) * 2020-09-10 2020-12-08 腾讯科技(深圳)有限公司 Code checking method, device, computer equipment and computer readable storage medium
CN112433699A (en) * 2020-11-05 2021-03-02 北京中电华大电子设计有限责任公司 Script engine for SE personalization
CN112564901A (en) * 2020-12-08 2021-03-26 浙江三维万易联科技有限公司 Key generation method and system, storage medium and electronic device
CN113221525A (en) * 2021-02-26 2021-08-06 平安普惠企业管理有限公司 Data processing method and device, electronic equipment and storage medium
CN112948275A (en) * 2021-04-27 2021-06-11 平安普惠企业管理有限公司 Test data generation method, device, equipment and storage medium
CN113342842A (en) * 2021-06-10 2021-09-03 南方电网数字电网研究院有限公司 Semantic query method and device based on metering knowledge and computer equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
NAEEM AKHTER: "Script independent offline writer identification using handwriting style", 3RD INTERNATIONAL CONFERENCE ON IMAGING FOR CRIME DETECTION AND PREVENTION (ICDP 2009) *
凌永发,张云生,郭秀萍: "软件测试自动化中的脚本技术", 云南民族学院学报(自然科学版), no. 01 *
李栋: "基于语义的角色动画生成系统的研究与实现", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI809861B (en) * 2022-05-10 2023-07-21 新漢股份有限公司 Depolyment system for internet of things and deployment method for the same
CN115756443A (en) * 2022-12-02 2023-03-07 中电金信软件有限公司 Script generation method and device, electronic equipment and readable storage medium
CN115756443B (en) * 2022-12-02 2023-08-25 中电金信软件有限公司 Script generation method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN114025027B (en) 2023-10-03

Similar Documents

Publication Publication Date Title
CN103034483B (en) web page script management method and system
CN109617646B (en) Message conversion method and device, computer equipment and computer readable storage medium
US20120017222A1 (en) Interface For Telecommunication Services Using Uniform Resource Identifiers
CN114025027B (en) Method and device for running data transmission script, storage medium and electronic device
CN109617647B (en) Message conversion method and device, computer equipment and computer readable storage medium
US20160050128A1 (en) System and Method for Facilitating Communication with Network-Enabled Devices
US11150896B2 (en) Automated generation of service definitions for message queue application clients
CN113364853B (en) Business service system, business request method and gateway equipment
CN108021710A (en) A kind of dynamic socket conversion method, device, terminal device and storage medium
CN110928548B (en) Data processing method and device
CN111061678B (en) Service data processing method, device, computer equipment and storage medium
CN110413845B (en) Resource storage method and device based on Internet of things operating system
CN107291608B (en) Test script generation method, interface subscription/registration method and device
CN112906206B (en) Digital twin model construction method and device
CN110912782A (en) Data acquisition method, device and storage medium
CN112287013A (en) Data conversion method and adapter
CN111106899A (en) Data verification method and device in Internet of things, computer equipment and storage medium
CN111177243B (en) Data export method and device, storage medium and electronic device
CN110855459B (en) Network configuration method, device and system
CN112422450A (en) Computer equipment, and flow control method and device for service request
CN116668520A (en) Gateway-based service arrangement method, system, equipment and storage medium
CN115333943B (en) Deterministic network resource allocation system, method, device and storage medium
CN111045928A (en) Interface data testing method, device, terminal and storage medium
CN109725931A (en) A kind of jenkins construction method and device
CN115604343A (en) Data transmission method, system, 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
TA01 Transfer of patent application right

Effective date of registration: 20220425

Address after: 310053 Block C, 3D building, 581 torch Avenue, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: SUNWAVE COMMUNICATIONS Co.,Ltd.

Address before: 310053 Room C, 3D building, 581 torch Avenue, Binjiang District, Hangzhou City, Zhejiang Province 310053

Applicant before: Zhejiang Sanwei wanyilian Technology Co.,Ltd.

Applicant before: SUNWAVE COMMUNICATIONS Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant