CN114025027B - Method and device for running data transmission script, storage medium and electronic device - Google Patents

Method and device for running data transmission script, storage medium and electronic device Download PDF

Info

Publication number
CN114025027B
CN114025027B CN202111289734.2A CN202111289734A CN114025027B CN 114025027 B CN114025027 B CN 114025027B CN 202111289734 A CN202111289734 A CN 202111289734A CN 114025027 B CN114025027 B CN 114025027B
Authority
CN
China
Prior art keywords
target
data transmission
script
grammar
transmission 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.)
Active
Application number
CN202111289734.2A
Other languages
Chinese (zh)
Other versions
CN114025027A (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
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 Sunwave Communications Co Ltd filed Critical Sunwave Communications 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

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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a method and a device for operating a data transmission script, a storage medium and an electronic device, 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-established reference script templates; generating a data transmission script corresponding to the target data transmission request through a target script template; and running a data transmission script. The method and the device solve the problem of lower efficiency of creating the data transmission script for transmitting the data for the target application in the related technology, and further achieve the effect of improving the efficiency of creating the data transmission script for transmitting the data for the target application.

Description

Method and device for running data transmission script, storage medium and electronic device
Technical Field
The embodiment of the invention relates to the field of data management, in particular to a method and a device for operating a data transmission script, a storage medium and an electronic device.
Background
In recent years, with the high-speed development of the internet of things technology, in order to meet the management requirements of internet of things applications and internet of things equipment, the internet of things application platform is often used for managing the internet of things applications and the internet of things equipment, and can realize data transmission between the internet of things applications and the internet of things equipment, but related technologies need to customize and develop application functions on the internet of things platform when based on the internet of things platform for data management between internet of things references and the internet of things equipment, manually butt-joint application data protocols, manage data between the applications and the internet of things equipment according to the manually created data protocols, and when the accessed applications or functions of the applications are different, need to encode the application data protocols again, so the method can also repeatedly carry out manual programming operation of the data protocols, and cannot adapt to application requirements of flexible and changeable services.
Aiming at the problem that the efficiency of creating a data transmission script for transmitting data for a target application is low in the related art, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for operating a data transmission script, a storage medium and an electronic device, which are used for at least solving the problem that the efficiency of creating the data transmission script for transmitting data for a target application is lower in the related technology.
According to one embodiment of the present invention, there is provided a method for operating a data transmission 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-established 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, 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 codes 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 coding mode corresponding to the target data transmission request includes: determining a grammar structure corresponding to the target attribute from data attributes and grammar structures with corresponding relations to obtain a grammar structure set, wherein the grammar structure is used for indicating target codes of target functions; determining target association relations between grammar structures included in the grammar structure set in a target map, wherein the target map is used for storing coded grammar structures and association relations between the grammar structures in a map form; and determining the target coding mode according to the grammar structure set and the target association relation.
Optionally, determining the target coding mode according to the grammar structure set and the target association relation includes: determining a calling sequence conforming to the target association relationship among grammar structures included in the grammar structure set; and determining the target coding mode to call the grammar structures included in the grammar structure set according to the call sequence.
Optionally, before determining the target association relationship between the grammar structures included in the grammar structure set in the target map, the method further comprises obtaining a reference character stream, wherein the reference character stream contains codes 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 association relation between the reference grammar structure; and constructing the target map according to the reference grammar structure and the reference association relation.
Optionally, after constructing the target atlas according to the reference syntax structure and the reference association 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 data in the reference character stream is detected to be changed; under the condition that a grammar structure corresponding to the reference character stream in the target map is detected to be in an un-called state, the modified reference character stream is identified by using the preset grammar rule, and the reference association relationship between the modified reference grammar structure and the modified reference grammar structure is obtained; constructing a reference map according to the association relationship between the modified reference grammar structure and the modified reference grammar structure; and updating the target map by using the reference map to obtain the updated target map.
Optionally, 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.
According to still another embodiment of the present invention, there is also provided an apparatus for running a data transmission script, including: the first acquisition module is used for 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; 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; the generation module is used for 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 the operation module is used for operating the data transmission script.
According to a further embodiment of the invention, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the invention, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the method and the device, the target data transmission request of the 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-established reference script templates; generating a data transmission script corresponding to the target data transmission request through a target script template, wherein an implementation code for transmitting target data for a target application is recorded in the data transmission script; the method comprises the steps of running a data transmission script, namely creating a reference script template in advance, generating an implementation code of the data transmission script for executing a corresponding data transmission request through the reference script template, and when the attribute of data requested to be transmitted for a target application is different, the used reference script template is different, when the target data transmission request for requesting to transmit the target data with the target attribute is acquired, selecting the target script template matched with the target attribute according to the target attribute of the target data requested to be transmitted, further generating the implementation code of the corresponding data transmission script according to the target script template, and when the generated data transmission script is run, realizing the requirement of transmitting the target data with the target attribute for the target application, thereby avoiding the complex operation of manually creating the data transmission script for executing the data transmission request for the target application, solving the problem of lower efficiency of creating the data transmission script for the target application for transmitting the data in the related technology, and achieving the effect of improving the efficiency of creating the data transmission script for transmitting the data for the target application.
Drawings
FIG. 1 is a block diagram of a mobile terminal hardware architecture of a method for operating a data transmission script according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of operating a data transfer script in accordance with an embodiment of the present application;
FIG. 3 is a diagram of an alternative data processing system in accordance with an embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative data processing process according to an embodiment of the application;
fig. 5 is an alternative data transmission flow diagram in accordance with an embodiment of the present application;
fig. 6 is a block diagram of a data transmission script running apparatus according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below 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 the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the operation on the mobile terminal as an example, fig. 1 is a block diagram of a mobile terminal hardware structure of an operation method of a data transmission script according to an embodiment of the present application. As shown in fig. 1, a mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. 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 a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for operating a data transmission script in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104, thereby performing various functional applications and data processing, that is, implementing the above-mentioned method. 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 remotely located relative to the processor 102, which may be connected to the mobile terminal via 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 means 106 is arranged to receive or transmit 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 (Network Interface Control ler, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In this embodiment, a method for operating a data transmission script is provided, and fig. 2 is a flowchart of a method for operating a data transmission script according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
step S202, a target data transmission request of a target application is obtained, wherein the target data transmission request is used for requesting to transmit target data with target attributes for the target application;
step S204, 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;
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
Step S208, running the data transmission script.
Through the steps, the reference script template is created in advance, the realization code of the data transmission script for executing the corresponding data transmission request can be generated through the reference script template, when the attribute of the data transmitted by the request for the target application is different, the used reference script template is also different, when the target data transmission request for requesting the target application to transmit the target data with the target attribute is acquired, the target script template matched with the target attribute can be selected according to the target attribute of the target data for requesting the transmission, the realization 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 attribute 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, so that the problem that the efficiency of creating the data transmission script for the target application is low in the related technology is solved, and the effect of improving the efficiency of creating the data transmission script for the data for the target application is achieved.
In the technical solution provided in step S202, the target application is an application for managing the internet of things device, for example, the target application may be an application for managing the home appliance device.
Alternatively, in this embodiment, the target data transmission request may be in the form of an identification signal corresponding to the request, a section of a sentence for describing the target data having the target attribute, or a character stream for describing the target data having the target attribute, for example, when the operator registers the target application, the target data transmission request in the form of a signal can be generated by the back end of the attribute selected by the front end when the operator registers the page according to the attribute of the data to be transmitted selected by the application, or the target data transmission request in the form of a sentence for describing the attribute of the data to be transmitted (for example, the data of the attribute is required by an application), or the target data transmission request in the form of a character stream describing the attribute of the data to be transmitted.
Alternatively, in the present embodiment, the target data transmission request may be determined according to, but not limited to, a functional attribute of an application, an application scenario of the application, a linkage rule of a plurality of application scenarios of the application, and the like. For example, when an operator registers a target application to an application management platform of the internet of things, the functional attribute of the target application (such as an air conditioning device for managing a certain model) needs to be checked out on a registration page, so that a target data transmission request for acquiring operation data of the air conditioning device of the certain model is generated according to the functional attribute of the selected target application; when an operator registers a target application on the application management platform of the internet of things, setting an application scene of the target application (for example, acquiring operation data of an air conditioning device of a certain model once at 8 am every day) on a registration page, so that the operation data of the air conditioning device of the certain model can be generated according to the set application scene; the target data transmission request according to the linkage rule of the plurality of application scenes of the application can be that an operator sets the linkage rule among the plurality of application scenes of the target application in the registration page when registering the target application on the application management platform of the internet of things (for example, when the operation parameter of the air conditioning equipment reaches a certain value, the air conditioning equipment is closed, the operation parameter of the air conditioning equipment is detected when one linkage scene comprises two application scenes, and the air conditioning equipment is closed when the operation parameter of the air conditioning equipment is higher than a certain value), so that two target data transmission requests are generated according to the set application scene linkage rule, namely, the target data transmission request for acquiring the operation parameter of the air conditioning equipment and the target data transmission request for transmitting the closing instruction to the air conditioning equipment, the two data transmission requests have a sequential relationship in the linkage rule among the application scenes, and the target data transmission request for acquiring the operation parameter is operated first, and the target data transmission request for transmitting the closing instruction to the air conditioning equipment is operated when the operation parameter reaches a certain value is detected.
Alternatively, 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 data, and the like.
Alternatively, in this embodiment, the target data transmitted for the target application may be data sent by the target application, or may be data sent to the target application, which is not limited in this scheme. In the technical solution provided in the above step S204, the reference script template is a script template storing a general code for executing a certain type of data transmission request.
Optionally, in this embodiment, there is a correspondence between the reference script template in the script template library and the attribute of the data to be transmitted, and the transmitted data attribute is different, and the reference script template to be used is different.
In the technical solution provided in step S206, the method for generating the data transmission script by using 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 use the coding mode corresponding to the target attribute to change the coding format and syntax structure of the target script template to obtain the data transmission script, which is not limited in this scheme.
In the technical solution provided in step S208, the data transmission script may be executed on an internet of things application management platform that manages the target application and the internet of things device, or may be executed on a terminal device that installs the target application or on the internet of things device, which is not limited in this solution.
FIG. 3 is a diagram of an alternative data processing system for data processing between an Internet of things application and an Internet of things device, according to an embodiment of the invention, as shown in FIG. 3, which may include, but is not limited to, the following operations: an operator creates a target application on WEB, performs object definition on the target application, such as defining functional attributes of the target application, defining an application instance (specific application scene) of the target application, a linkage rule (joint use of a plurality of instances) 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 application management platform of the Internet of things, requests the management platform to execute a command corresponding to the data transmission request, and acquires an execution result of executing the data transmission request returned by the application management platform of the Internet of things; the method comprises the steps that various types of Internet of things equipment, third party service objects (such as companies or enterprises for managing applications) and business systems are connected under an Internet of things application management platform; the management of the application instance of the created target application, the management of the Internet of things object, the analysis of the dependency relationship between the application instances and between the application instance and the Internet of things equipment can be realized on the Internet of things application management platform, so that the needed data can be searched in the data of the Internet of things equipment according to the generated data transmission request, and the searched data can be sent to the target application, the third party service object and the corresponding service system, or the data generated by the target application can be also transmitted to the Internet of things equipment, the third party service object and the service system connected under the Internet of things management platform.
FIG. 4 is a schematic diagram of an alternative data processing procedure applied to data processing between an Internet of things application and an Internet of things device according to an embodiment of the present invention, as shown in FIG. 4, the above 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, universal 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 side, corresponding options are selected through hooking out on the WEB page, so that definition of the target application is realized;
s402, after the target application is defined on the WEB page, creating an instance according to an application instance of the target application, thereby creating an actual use scene of the target application, for example, acquiring operation data of certain type of Internet of things equipment;
s403, after the application examples of the target application and the target application are defined on the application platform of the Internet of things, a binding relation between the examples and the equipment of the Internet of things can be constructed according to the created application examples and application definitions;
S404, a script template library is created in advance at a storage position, a plurality of pre-created reference script templates are stored in the script template library, universal 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 various types of Internet of things application equipment, can acquire running data of the Internet of things equipment, and generates a target data transmission request according to application definition and created examples of target applications, so that the corresponding reference script template is matched in a script template library according to the target data transmission request, and the reference script template is modified according to the target data transmission request, so that a data transmission script for executing the data transmission request is obtained, message routing corresponding to the data transmission request is carried out between the target application and the Internet of things equipment according to the data transmission script, and linkage rules among multiple examples of the target application and data processing of the Internet of things application can be realized;
s406, a plurality of Internet of things devices are connected under the Internet of things application platform, and the Internet of things devices transmit own operation data to the Internet of things application platform.
As an alternative example, generating, by the target script template, the data transfer script corresponding to the target data transfer 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 codes 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 target coding manner may be determined in the data transmission request and the coding manner that have a corresponding relationship, or may be generated according to the target data transmission request, or may be sent after other devices query related data according to the target data transmission request to obtain the target coding manner.
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 specific use of a character, an association relationship of characters, a sequence of characters, and the like, which is not limited in this scheme.
Alternatively, in the present embodiment, the target encoding mode may include, but is not limited to, one or more encoding rules.
As an optional example, acquiring the target coding manner corresponding to the target data transmission request includes:
determining a grammar structure corresponding to the target attribute from data attributes and grammar structures with corresponding relations to obtain a grammar structure set, wherein the grammar structure is used for indicating target codes of target functions;
determining target association relations between grammar structures included in the grammar structure set in a target map, wherein the target map is used for storing coded grammar structures and association relations between the grammar structures in a map form;
and determining the target coding mode according to the grammar structure set and the target association relation.
Alternatively, in the present embodiment, the syntax structure is an object code composed of specific characters and having a specific meaning in the domain to which the object data transmission request belongs, and the syntax structure may include, but is not limited to, modifiers, operators, interfaces, return values, code notes, and the like, which is not limited.
Optionally, in this embodiment, the target association relationship is used to indicate a usage relationship between the grammar structures, such as a calling order of the grammar structures in a specific scenario, or other grammar structures that are used with a certain grammar structure need to be called together when the certain grammar structure is called.
Alternatively, in the present embodiment, the object code may include, but is not limited to, characters, numbers, combinations of characters or numbers, and the like, which is not limited thereto.
Optionally, in this embodiment, the target graph is a representation of a graph describing a grammar of the program code, where the graph has a plurality of nodes with association relationships, each node represents a grammar structure (such as a modifier, an operator, an interface, a return value, a code annotation, etc.), and the target graph may include, but is not limited to, an AST (Abstract Syntax Tree ) graph, a CST (Concrete Syntax Tree, concrete syntax tree) graph, and so on.
As an optional example, determining the target coding manner according to the syntax structure set and the target association relation includes:
determining a calling sequence conforming to the target association relationship among grammar structures included in the grammar structure set;
And determining the target coding mode to call the grammar structures included in the grammar structure set according to the call sequence.
Alternatively, in this embodiment, determining the calling order of the grammar structures in the grammar structure set may be determining the sequence of the queried grammar structures as the calling order of the grammar structures by a method of querying in the target map according to the grammar structures.
As an alternative 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 codes 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 association relation between the reference grammar structure;
and constructing the target map according to the reference grammar structure and the reference association relation.
Alternatively, in the present embodiment, the reference character stream may be a preset character stream including codes for requesting (a request corresponding to a defined target application function, a request corresponding to an application scenario of a target application having a linkage relationship, and the like) transmission of data of a certain attribute for the target application, for example, codes corresponding to execution of various data transmission requests are preset, and these codes are set 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 by using the preset grammar rule, for example, a rule engine grammar is defined based on Ant lr, 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 using the rule engine grammar.
Alternatively, 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 scheme.
As an optional example, after constructing the target atlas according to the reference syntax structure and the reference association 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 data in the reference character stream is detected to be changed;
under the condition that a grammar structure corresponding to the reference character stream in the target map is detected to be in an un-called state, the modified reference character stream is identified by using the preset grammar rule, and the reference association relationship between the modified reference grammar structure and the modified reference grammar structure is obtained;
Constructing a reference map according to the association relationship between the modified reference grammar structure and the modified reference grammar structure;
and updating the target map by using the reference map to obtain the updated target map.
Optionally, in this embodiment, the data in the reference character stream may be changed to indicate the numerical value, or may be changed to the type of data transmitted, or may be changed to the transmission object and the receiving object of the data transmitted, which is not limited in this scheme.
Optionally, in this embodiment, whether the syntax structure corresponding to the reference character stream is in the invoked state may be detected by detecting whether the corresponding syntax 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 alternative example, 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.
Optionally, in this embodiment, the template tags may set weights, and the matching degree is obtained by weighting the matched template tags, and the weight values of different template tags may set the same weight value or different weight values.
Alternatively, 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 flow chart according to an embodiment of the present application, applied to the application management platform of the internet of things in fig. 3 and 4, as shown in fig. 5, the above process may include, but is not limited to, the following steps:
s501, an application management platform of the Internet of things acquires a data transmission request of a target application;
s502, a script template library is created in advance, a plurality of reference script templates which are created in advance are stored in the script template library, universal 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 a matched reference script template 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, thereby obtaining 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, the application management platform of the Internet of things selects data matched with the data transmission request from the device data;
s506, the rule executor executes a data transmission script, the data is forwarded through the data transmission script, the rule executor can directly send the data to be forwarded to the forwarding module, and the step S507 can be executed;
s507, a time condition for triggering is set in the timing triggering module, and the data is triggered and sent to the forwarding module after the time condition is met;
and S508, the forwarding module sends the target data to be transmitted to the corresponding application, equipment, memory and the like through the data transmission script.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
In this embodiment, there is further provided an apparatus for running a data transmission script, and fig. 6 is a block diagram of a structure of an apparatus for running 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 configured to record a plurality of reference script templates created in advance;
a generating module 66, configured to generate, by using 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 operation module 68 for operating the data transmission script.
Optionally, the generating module includes: an obtaining unit, configured to obtain a target coding manner corresponding to the target data transmission request, where the target coding manner is used to indicate a coding 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 acquiring unit is configured to: determining a grammar structure corresponding to the target attribute from data attributes and grammar structures with corresponding relations to obtain a grammar structure set, wherein the grammar structure is used for indicating target codes of target functions; determining target association relations between grammar structures included in the grammar structure set in a target map, wherein the target map is used for storing coded grammar structures and association relations between the grammar structures in a map form; and determining the target coding mode according to the grammar structure set and the target association relation.
Optionally, the acquiring unit is configured to: determining a calling sequence conforming to the target association relationship among grammar structures included in the grammar structure set; and determining the target coding mode to call the grammar structures included in the grammar structure set according to the call sequence.
Optionally, the device further comprises a second acquisition module, configured to acquire a reference character stream before determining a target association relationship between grammar structures included in the grammar structure set in a target atlas, 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 association relation between the reference grammar structure; the first construction module is used for constructing the target map according to the reference grammar structure and the reference association relation.
Optionally, the apparatus further comprises: the detection module is used for detecting whether the grammar structure corresponding to the reference character stream in the target atlas is in a called state or not under the condition that the change of the data in the reference character stream is detected after the target atlas is constructed according to the reference grammar structure and the reference association relation; the processing module is used for identifying the modified 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 relationship between the modified reference grammar structure and the modified reference grammar structure; the second construction module is used for constructing a reference map according to the association relation between the modified reference grammar structure and the modified 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 calling module includes: the acquisition unit is used for acquiring a template label of the reference script template in the script template library, wherein the template label is used for indicating the functional 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 each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Embodiments of the present invention also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic apparatus may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps 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 of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A method for operating a data transmission 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-established 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;
running the data transmission script;
wherein 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 codes 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.
2. The method of claim 1, wherein obtaining the target coding scheme corresponding to the target data transmission request comprises:
determining a grammar structure corresponding to the target attribute from data attributes and grammar structures with corresponding relations to obtain a grammar structure set, wherein the grammar structure is used for indicating target codes of target functions;
determining target association relations between grammar structures included in the grammar structure set in a target map, wherein the target map is used for storing coded grammar structures and association relations between the grammar structures in a map form;
and determining the target coding mode according to the grammar structure set and the target association relation.
3. The method of claim 2, wherein determining the target coding scheme from the set of syntax structures and the target association comprises:
determining a calling sequence conforming to the target association relationship among grammar structures included in the grammar structure set;
and determining the target coding mode to call the grammar structures included in the grammar structure set according to the call sequence.
4. The method of claim 2, wherein prior to determining the target association between the grammar structures included in the set of grammar structures in the target atlas, the method further comprises:
acquiring a reference character stream, wherein the reference character stream comprises codes 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 association relation between the reference grammar structure;
and constructing the target map according to the reference grammar structure and the reference association relation.
5. The method of claim 4, wherein after constructing the target atlas according to the reference syntax structure and the reference association 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 data in the reference character stream is detected to be changed;
under the condition that a grammar structure corresponding to the reference character stream in the target map is detected to be in an un-called state, the modified reference character stream is identified by using the preset grammar rule, and the reference association relationship between the modified reference grammar structure and the modified reference grammar structure is obtained;
Constructing a reference map according to the association relationship between the modified reference grammar structure and the modified reference grammar structure;
and updating the target map by using the reference map to obtain the updated target map.
6. 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.
7. An apparatus for running a data transmission script, comprising:
the first acquisition module is used for 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;
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;
The generation module is used for 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;
the operation module is used for operating the data transmission script;
wherein, the generating module includes: an obtaining unit, configured to obtain a target coding manner corresponding to the target data transmission request, where the target coding manner is used to indicate a coding 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.
8. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program, when being executed by a processor, implements the steps of the method according to any of the claims 1 to 6.
9. 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 processor implements the steps of the method of any one of claims 1 to 6 when the computer program is executed.
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 CN114025027A (en) 2022-02-08
CN114025027B true 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)

Families Citing this family (2)

* 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
CN115756443B (en) * 2022-12-02 2023-08-25 中电金信软件有限公司 Script generation method and device, electronic equipment and readable storage medium

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Family Cites Families (3)

* 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
EP1447759A1 (en) * 2003-02-07 2004-08-18 ARM Limited Generation of a testbench for a representation of a device
IL286639B2 (en) * 2015-01-29 2023-10-01 Quantum Metric Inc Techniques for compact data storage of network traffic and efficient search thereof

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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
Script independent offline writer identification using handwriting style;Naeem Akhter;3rd International Conference on Imaging for Crime Detection and Prevention (ICDP 2009);全文 *
基于语义的角色动画生成系统的研究与实现;李栋;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;全文 *
软件测试自动化中的脚本技术;凌永发,张云生,郭秀萍;云南民族学院学报(自然科学版)(01);全文 *

Also Published As

Publication number Publication date
CN114025027A (en) 2022-02-08

Similar Documents

Publication Publication Date Title
CN114025027B (en) Method and device for running data transmission script, storage medium and electronic device
CN109617646B (en) Message conversion method and device, computer equipment and computer readable storage medium
CN109617647B (en) Message conversion method and device, computer equipment and computer readable storage medium
CN112287013B (en) Data conversion method and adapter
CN109213758B (en) Data access method, device, equipment and computer readable storage medium
CN111061678B (en) Service data processing method, device, computer equipment and storage medium
CN111106899B (en) Data verification method and device in Internet of things, computer equipment and storage medium
CN110912782B (en) Data acquisition method, device and storage medium
CN110928548B (en) Data processing method and device
CN112906206B (en) Digital twin model construction method and device
CN114416075A (en) Service processing method and device
CN114553784A (en) Current limiting processing method and device
CN108429764B (en) Data transmission and analysis method based on private protocol
CN113434175A (en) Data processing method, device, storage medium and equipment
CN111177243B (en) Data export method and device, storage medium and electronic device
CN114282519A (en) CAN data analysis method and device
CN113591448B (en) Report generation method, device and storage medium
CN110855459B (en) Network configuration method, device and system
CN113467782B (en) Method, device and equipment for determining business process
CN110019444A (en) A kind of operation requests processing method, device, equipment and system
CN110928995B (en) Interactive information processing method, device, equipment and storage medium
CN116991929A (en) Micro-service system based on big hospital data
CN115333943B (en) Deterministic network resource allocation system, method, device and storage medium
CN116668520A (en) Gateway-based service arrangement method, system, equipment and storage medium
CN111400060B (en) Equipment linkage method, device, server and 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