A data processing method for developing a driver based on a script language

By introducing the combination of a data I/O layer and a scripting language runtime into driver development, driver development using scripting languages ​​is realized, reducing development difficulty and enabling scripting language developers to apply their skills in driver development, thus solving the problem of driver developer shortage.

CN115145553BActive Publication Date: 2026-11-27HANGZHOU INSTRUCTION SET INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210819597.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-12
Publication Date
2026-11-27
Estimated Expiration
2042-07-12

AI Technical Summary

Technical Problem

In the existing technology, driver development requires the use of low-level languages ​​such as C and C++, which leads to high learning costs, a shortage of driver developers, and scripting languages ​​cannot be directly used for driver development.

Method used

The data I/O layer is written in a preset programming language, and the runtime of the scripting language is configured to connect with the data I/O layer, receive and process data from hardware devices, perform data processing using the runtime of the scripting language, and return the execution result.

Benefits of technology

It lowers the barrier to driver development, enabling developers who are proficient in scripting languages ​​to work in driver development scenarios, and solves the drawback that scripting languages ​​cannot be directly used for driver development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115145553B_ABST
    Figure CN115145553B_ABST
Patent Text Reader

Abstract

The application relates to a data processing method for developing a driver based on a script language, which comprises the following steps: preset programming language is used to write a data I / O layer, wherein the data I / O layer is used for inputting / outputting data from a hardware device; a runtime of a script language is configured, and the runtime of the script language is connected with the data I / O layer; reported data from the hardware device is received, and the reported data is sent to the runtime of the script language through the data I / O layer; the runtime of the script language receives the reported data and processes the data, and returns an execution result. The method realizes that a script language is used to develop a driver, the development threshold of the driver is directly reduced, a disadvantage that a script language cannot be used for driver development is solved, and a developer who masters the script language can also work in a driver development scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Internet technology, and in particular to a data processing method, apparatus and system for developing drivers based on a scripting language. Background Technology

[0002] A scripting language is a data processing programming language based on scripting language development. In a special runtime environment, it can automatically execute tasks or be executed one by one by a human operator.

[0003] As for drivers, their essence is to enable data interaction between software and hardware by using the operating system as a platform. Under current technology, driver development requires the use of low-level languages ​​such as C and C++, rather than more general-purpose scripting languages. This increases the demand for skilled driver developers and imposes higher costs on related production processes for enterprises.

[0004] In most cases, drivers are developed using low-level languages ​​(such as C, C++, etc.) rather than scripting languages. Low-level languages ​​have a high learning curve and are difficult to master in today's technological environment. This has directly led to a severe shortage of driver developers in the current era of transitioning from the Internet to the Internet of Things (IoT), due to the massive increase in devices. To date, there are no other solutions that use scripting languages ​​for driver development. Summary of the Invention

[0005] To address the aforementioned issues, this application proposes a data processing method, apparatus, and system based on scripting language-based driver development.

[0006] This application proposes a data processing method for developing drivers based on a scripting language, comprising the following steps:

[0007] A data I / O layer is written using a preset programming language, wherein the data I / O layer is used to input / output data from hardware devices;

[0008] Configure the runtime of the scripting language and connect the runtime of the scripting language to the data I / O layer;

[0009] Receive reported data from the hardware device and send the reported data to the runtime of the scripting language through the data I / O layer;

[0010] The runtime of the scripting language receives and processes reported data, and returns the execution result.

[0011] As an optional implementation of this application, the data I / O layer may be written using a preset programming language, including:

[0012] Pre-set development environment and design rules;

[0013] Based on the aforementioned development environment and design rules, I / O layer code was written in C language;

[0014] The data I / O layer is generated based on the I / O layer code, and the data I / O layer is configured in the application environment of the hardware device.

[0015] As an optional implementation of this application, optionally, configuring the runtime of the scripting language and connecting the runtime of the scripting language to the data I / O layer includes:

[0016] Write script code using a scripting language;

[0017] The runtime environment and corresponding reference libraries required for the script code are introduced, and the runtime of the script language is constructed using the runtime environment and the reference libraries;

[0018] The script code is written into the runtime of the scripting language to obtain a scripting language application that serves as a driver, and the scripting language application is then connected to the data I / O layer.

[0019] As an optional implementation of this application, optionally, receiving reported data from the hardware device and sending the reported data to the runtime of the scripting language through the data I / O layer includes:

[0020] Receive reported data from the hardware device via serial port;

[0021] The data I / O layer receives the reported data and reads the reported data to obtain the source data in the reported data;

[0022] The source data is sent and written to the runtime of the scripting language to prepare for driver execution, wherein the application subject for driver execution is the scripting language application.

[0023] As an optional implementation of this application, optionally, before receiving the reported data from the hardware device and sending the reported data to the runtime of the scripting language through the data I / O layer, the method further includes:

[0024] The serial port is monitored by a preset C program, and it is determined whether the serial port has a response: if the serial port has a response, the reported data from the hardware device is received through the data I / O layer.

[0025] The C program reads the reported data, sends it as driving data, and writes it into the runtime of the scripting language.

[0026] As an optional implementation of this application, optionally, the runtime of the scripting language receives and processes the reported data, and returns the execution result, including:

[0027] Receive the drive data;

[0028] The scripting language application reads the driver data from the C program and writes data into the C program to complete the driver data processing and obtain the execution result—the data variable.

[0029] The data variables are returned to the hardware device through the data I / O layer that interfaces with the runtime of the scripting language.

[0030] In another aspect, this application proposes an apparatus for implementing the aforementioned data processing method for developing drivers based on scripting languages, comprising:

[0031] A data I / O layer construction module is used to write a data I / O layer using a preset programming language, wherein the data I / O layer is used to input / output data from hardware devices;

[0032] The runtime environment configuration module is used to configure the runtime of the scripting language and connect the runtime of the scripting language to the data I / O layer;

[0033] The data reporting module is used to receive reported data from the hardware device and send the reported data to the runtime of the scripting language through the data I / O layer;

[0034] The driver execution module is used to receive reported data and process the data during the runtime of the scripting language, and return the execution result.

[0035] As an optional implementation of this application, the runtime environment configuration module may optionally include:

[0036] The script code writing module is used to write script code based on a scripting language;

[0037] The runtime setup module is used to introduce the runtime environment and corresponding reference libraries required by the script code, and to build the runtime of the script language through the runtime environment and the reference libraries;

[0038] The scripting language application module is used to write the script code into the runtime of the scripting language to obtain the scripting language application as a driver, and to interface the scripting language application with the data I / O layer.

[0039] As an optional implementation of this application, the data reporting module may optionally include:

[0040] A data receiving serial port is used to receive reported data from the hardware device via a serial port.

[0041] The reading module is used by the data I / O layer to receive the reported data and read the reported data to obtain the source data in the reported data;

[0042] The driver preparation module is used to send the source data and write it into the runtime of the scripting language to prepare for driver execution, wherein the application subject of the driver execution is the scripting language application.

[0043] The serial port monitoring module is used to monitor the serial port through a preset C program and determine whether the serial port has a response. If the serial port has a response, the module receives the reported data from the hardware device through the data I / O layer. The C program reads the reported data, sends it as driver data, and writes it into the runtime of the scripting language.

[0044] As an optional implementation of this application, the drive execution module may optionally include:

[0045] The driver data processing module is configured to receive the driver data; and, through the scripting language application, read the driver data from the C program and write data into the C program to complete the driver data processing and obtain the execution result—a data variable; and, return the data variable to the hardware device through the data I / O layer that is connected to the runtime of the scripting language.

[0046] In another aspect, this application also proposes a data processing system, comprising:

[0047] processor;

[0048] And memory used to store processor-executable instructions;

[0049] The processor is configured to implement any of the aforementioned data processing methods for developing drivers based on scripting languages ​​when executing executable instructions.

[0050] Technical effects of the present invention:

[0051] This application utilizes a pre-defined programming language to develop a data I / O layer. This data I / O layer is used for inputting and outputting data from hardware devices. It configures a scripting language runtime and connects the runtime to the data I / O layer. It receives reported data from the hardware device and sends the reported data to the scripting language runtime via the data I / O layer. The scripting language runtime receives the reported data, processes it, and returns the execution result. This approach, starting with a scripting language and using the most widely mastered scripting language to develop drivers, directly lowers the barrier to driver development. It also addresses the limitation of scripting languages ​​being unsuitable for driver development, enabling developers proficient in scripting languages ​​to work in driver development scenarios.

[0052] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0053] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.

[0054] Figure 1 The diagram illustrates the implementation flow of the data processing method for developing drivers using a scripting language according to the present invention.

[0055] Figure 2 The diagram shows the execution flow of the present invention when the runtime of the scripting language performs driver processing on the driver data.

[0056] Figure 3 The diagram illustrates the data reading and writing process of this invention using a scripting language application. Detailed Implementation

[0057] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0058] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0059] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0060] Example 1

[0061] In the current environment, this invention starts with scripting languages, using the most widely mastered scripting languages ​​to develop drivers, which directly lowers the barrier to driver development.

[0062] This invention addresses the drawback that scripting languages ​​(in this embodiment, it specifically refers to commonly used scripting languages ​​such as javascript, python, groovy, and kotlinscript; niche scripting languages ​​or those with serious outdated features are not included) cannot be used for driver development, enabling developers who have mastered scripting languages ​​to work in driver development scenarios as well.

[0063] In this embodiment, the runtime environment for the scripting language is the environment in which the script code / program runs. This environment will be selected based on the runtime conditions chosen by the user. This embodiment does not impose specific requirements or limitations on it.

[0064] like Figure 1 As shown, this application proposes a data processing method for developing drivers based on a scripting language, comprising the following steps:

[0065] S1. Write a data I / O layer using a preset programming language, wherein the data I / O layer is used to input / output data from hardware devices;

[0066] In this invention, a data I / O layer is developed using the C language. This layer is solely used for inputting and outputting data from the hardware and does not perform any data processing; it is only for transmission. A complete scripting language runtime is introduced at the upper layer to interface with the I / O layer, ensuring that data can be received and sent within the scripting language. The upper-layer scripting language can be any mainstream scripting language (such as JavaScript, Python, etc.), as long as it can normally receive data from the C layer and send data to the C layer.

[0067] As an optional implementation of this application, the data I / O layer may be written using a preset programming language, including:

[0068] Pre-set development environment and design rules;

[0069] Based on the aforementioned development environment and design rules, I / O layer code was written in C language;

[0070] The data I / O layer is generated based on the I / O layer code, and the data I / O layer is configured in the application environment of the hardware device.

[0071] This application first requires developing / writing I / O layer code in C language to obtain the data I / O layer, which serves as the serial port for data reading in the C program. Therefore, the user must first create a development environment and design rules based on the specific project requirements to facilitate code development. These development environment and design rules will be set by the user, such as the programmer, according to the project requirements. Through coding, the I / O layer code written in C language is obtained. Based on this I / O layer code, it is run to obtain the data I / O layer. The data I / O layer will handle data input and output from the hardware, and it does not perform any data processing; it only performs transmission. A complete scripting language runtime is introduced at the upper layer to interface with the I / O layer, ensuring that data can be received and sent within the scripting language.

[0072] The application environment of the hardware device mentioned here refers to the network operating environment that the associated hardware device will join when reporting data. The data of the hardware device needs to be transmitted to the software through the serial port and read through the data I / O layer.

[0073] S2. Configure the runtime of the scripting language and connect the runtime of the scripting language to the data I / O layer;

[0074] The data I / O layer developed in C language, acting as a serial port for reading and writing data, needs to be configured within the runtime environment of a scripting language. Therefore, it is necessary to build the runtime environment and corresponding reference libraries required by the script code, establish the runtime conditions within the scripting language's runtime environment, and connect the scripting language's runtime with the data I / O layer to achieve the data read / write design.

[0075] like Figure 2 As shown, as an optional embodiment of this application, optionally, configuring the runtime of the scripting language and connecting the runtime of the scripting language to the data I / O layer includes:

[0076] Write script code using a scripting language;

[0077] The runtime environment and corresponding reference libraries required for the script code are introduced, and the runtime of the script language is constructed using the runtime environment and the reference libraries;

[0078] The script code is written into the runtime of the scripting language to obtain a scripting language application that serves as a driver, and the scripting language application is then connected to the data I / O layer.

[0079] Developers write script code and import the environment and reference libraries required by the script code (here, the environment specifically refers to the software necessary to run the specified script code, such as Node.js required to run JavaScript, and the reference libraries specifically refer to the third-party dependency libraries used by the script code). In other words, the runtime environment of the script language is constructed through the runtime environment and the reference libraries.

[0080] Because the script code corresponds to the script driver, when the script code is written into the runtime of the scripting language, a scripting language application ready to run and drive in the runtime environment of the scripting language is actually built. After it is connected to the data I / O layer, it is ready to drive the data processing.

[0081] S3. Receive the reported data from the hardware device, and send the reported data to the runtime of the scripting language through the data I / O layer;

[0082] When the driver data processing begins, the data reported by the hardware device is transmitted to the software via serial port. Data is read / written through the data I / O layer, then executed by the driver program. The execution result is then returned to the hardware device via serial port.

[0083] As an optional implementation of this application, optionally, receiving reported data from the hardware device and sending the reported data to the runtime of the scripting language through the data I / O layer includes:

[0084] Receive reported data from the hardware device via serial port;

[0085] The data I / O layer receives the reported data and reads the reported data to obtain the source data in the reported data;

[0086] The source data is sent and written to the runtime of the scripting language to prepare for driver execution, wherein the application subject for driver execution is the scripting language application.

[0087] In this embodiment, a serial port hardware device, such as a temperature data acquisition device, collects and reports ambient temperature information, using the PC screen as the information display medium. The data is reported from the hardware to the serial port, and the data from the serial port can be read by the C program (i.e., the data I / O layer).

[0088] like Figure 2As shown, after reading, the data is transmitted to the runtime of the scripting language. The configured scripting language application is used to drive data processing. After data processing is complete, data variables (driver execution results) are obtained. The results are then sent back to the serial port through the data I / O layer written in C language, and returned to the hardware device through the serial port. This realizes the driver processing of data through the scripting language application. Starting with scripting languages, and using the most widely mastered scripting language to develop driver programs, directly lowers the development threshold of drivers.

[0089] To facilitate data response, this embodiment also includes a listening program that listens to the serial port while the data is reported by the hardware, specifically through a C program to respond when the data is reported.

[0090] As an optional implementation of this application, optionally, before receiving the reported data from the hardware device and sending the reported data to the runtime of the scripting language through the data I / O layer, the method further includes:

[0091] The serial port is monitored by a preset C program, and it is determined whether the serial port has a response: if the serial port has a response, the reported data from the hardware device is received through the data I / O layer.

[0092] The C program reads the reported data, sends it as driving data, and writes it into the runtime of the scripting language.

[0093] A response from the serial port indicates that the hardware device has reported data, which is then read by the C program (data I / O layer). If there is no response, the program continues to wait.

[0094] S4. The runtime of the scripting language receives and processes the reported data, and returns the execution result.

[0095] In the runtime environment of a scripting language, the configured scripting language application will perform data-driven execution.

[0096] First, users need to develop applications (scripting language applications) using scripting languages ​​such as JavaScript and Python to read and display data from the C program. This involves the following actions: developers write script code and import the necessary environment and libraries (the environment specifically refers to the software required to run the specified script code, such as Node.js for JavaScript; libraries refer to third-party dependencies used by the script code). After the developers have completed their code, this invention is used to integrate and generate the code, enabling the script code to run as scheduled. Figure 3They are organized in a way that allows data to be read from or written to a C program.

[0097] like Figure 3 As shown, as an optional embodiment of this application, optionally, the runtime of the scripting language receives and processes the reported data, and returns the execution result, including:

[0098] Receive the drive data;

[0099] The scripting language application reads the driver data from the C program and writes data into the C program to complete the driver data processing and obtain the execution result—the data variable.

[0100] The data variables are returned to the hardware device through the data I / O layer that interfaces with the runtime of the scripting language.

[0101] When a scripting language application performs driver data processing, it first reads data from the C program and then writes data to the C program. The shared memory for reading and writing data at the bottom is allocated by the C program and allows the upper-level scripting program to read and write it.

[0102] At this point, the data variable can be displayed. Any technology can read the data variable and display it on the screen. Simultaneously, the script code written by the developers can be packaged, resulting in a collection of script code and C program, which can be directly extracted and used in another computer environment.

[0103] In this embodiment, scripting languages, because they come with their own runtime environments, are unrestricted in development. Developers can utilize their existing understanding of the language and their use of libraries to develop their code. Only the I / O layer code developed in C needs to be packaged together during the final packaging process.

[0104] Therefore, this application uses a pre-defined programming language to develop a data I / O layer. This data I / O layer is used for inputting and outputting data from hardware devices; configuring a scripting language runtime and connecting the scripting language runtime to the data I / O layer; receiving reported data from the hardware device and sending the reported data to the scripting language runtime through the data I / O layer; the scripting language runtime receiving the reported data, processing the data, and returning the execution result. This approach allows for driver development using the most widely used scripting language, directly lowering the development threshold. It also addresses the limitation of scripting languages ​​being unsuitable for driver development, enabling developers proficient in scripting languages ​​to work in driver development scenarios.

[0105] It should be noted that although the above description is provided as an example, those skilled in the art will understand that this disclosure is not limited thereto. In fact, users can flexibly configure the settings according to actual application scenarios, as long as the technical functions of this application can be achieved by following the above technical methods.

[0106] Example 2

[0107] Based on the implementation principle of Embodiment 1, this embodiment, and another aspect of this application, proposes an apparatus for implementing the data processing method for developing drivers based on scripting languages, comprising:

[0108] A data I / O layer construction module is used to write a data I / O layer using a preset programming language, wherein the data I / O layer is used to input / output data from hardware devices;

[0109] The runtime environment configuration module is used to configure the runtime of the scripting language and connect the runtime of the scripting language to the data I / O layer;

[0110] The data reporting module is used to receive reported data from the hardware device and send the reported data to the runtime of the scripting language through the data I / O layer;

[0111] The driver execution module is used to receive reported data and process the data during the runtime of the scripting language, and return the execution result.

[0112] As an optional implementation of this application, the runtime environment configuration module may optionally include:

[0113] The script code writing module is used to write script code based on a scripting language;

[0114] The runtime setup module is used to introduce the runtime environment and corresponding reference libraries required by the script code, and to build the runtime of the script language through the runtime environment and the reference libraries;

[0115] The scripting language application module is used to write the script code into the runtime of the scripting language to obtain the scripting language application as a driver, and to interface the scripting language application with the data I / O layer.

[0116] As an optional implementation of this application, the data reporting module may optionally include:

[0117] A data receiving serial port is used to receive reported data from the hardware device via a serial port.

[0118] The reading module is used by the data I / O layer to receive the reported data and read the reported data to obtain the source data in the reported data;

[0119] The driver preparation module is used to send the source data and write it into the runtime of the scripting language to prepare for driver execution, wherein the application subject of the driver execution is the scripting language application.

[0120] The serial port monitoring module is used to monitor the serial port through a preset C program and determine whether the serial port has a response. If the serial port has a response, the module receives the reported data from the hardware device through the data I / O layer. The C program reads the reported data, sends it as driver data, and writes it into the runtime of the scripting language.

[0121] As an optional implementation of this application, the drive execution module may optionally include:

[0122] The driver data processing module is configured to receive the driver data; and, through the scripting language application, read the driver data from the C program and write data into the C program to complete the driver data processing and obtain the execution result—a data variable; and, return the data variable to the hardware device through the data I / O layer that is connected to the runtime of the scripting language.

[0123] For details on the implementation principles and functions of each of the above modules, please refer to the description in Example 1. This example will not elaborate further.

[0124] Obviously, those skilled in the art should understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the control methods described above. The modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. Thus, the present invention is not limited to any specific hardware and software combination.

[0125] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the control methods described above. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.

[0126] Example 3

[0127] Furthermore, in another aspect, this application also proposes a data processing system, comprising:

[0128] processor;

[0129] And memory used to store processor-executable instructions;

[0130] The processor is configured to implement any of the aforementioned data processing methods for developing drivers based on scripting languages ​​when executing executable instructions.

[0131] This disclosure discloses a data processing system including a processor and a memory for storing processor-executable instructions. The processor is configured to implement any of the preceding data processing methods for developing drivers based on a scripting language when executing the executable instructions.

[0132] It should be noted here that the number of processors can be one or more. Furthermore, the data processing system of this embodiment may also include input devices and output devices. The processors, memory, input devices, and output devices can be connected via a bus or other means, without specific limitations herein.

[0133] As a computer-readable storage medium, memory can be used to store software programs, computer-executable programs, and various modules, such as the program or module corresponding to the data processing method for developing driver programs based on a scripting language according to embodiments of this disclosure. The processor executes various functional applications and data processing of the data processing system by running the software programs or modules stored in the memory.

[0134] Input devices can be used to receive input digital numbers or signals. These signals can be key signals related to user settings and function control of the device / terminal / server. Output devices can include display devices such as screens.

[0135] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A data processing method for developing drivers based on a scripting language, characterized in that, Includes the following steps: A data I / O layer is written using a preset programming language. The data I / O layer is used to input / output data from hardware devices. The data I / O layer itself does not process the data and is only used for transmission. It is a pure C program data reading serial port. Configuring the runtime of the scripting language and connecting the runtime of the scripting language with the data I / O layer includes: writing script code based on the scripting language; introducing the runtime environment and corresponding reference libraries required by the script code; constructing the runtime of the scripting language through the runtime environment and the reference libraries; writing the script code into the runtime of the scripting language to obtain the scripting language application as a driver; and completing the interface between the scripting language application and the data I / O layer. Receive reported data from the hardware device and send the reported data to the runtime of the scripting language through the data I / O layer; The runtime of the scripting language receives and processes reported data, and returns the execution result, including: receiving driver data; reading the driver data from the C program and writing data into the C program through the scripting language application, completing the driver data processing, and obtaining the execution result—a data variable; wherein, the shared read / write data memory is allocated by the C program and allows the upper-level script program to read and write; returning the data variable to the hardware device through the data I / O layer that is connected to the runtime of the scripting language; packaging the script code written by the developer and the I / O layer code developed using C, the packaged product being a collection of script code and C program, which can be directly placed in another computer environment and decompressed for use.

2. The data processing method for developing drivers based on a scripting language according to claim 1, characterized in that, Write the data I / O layer using a pre-defined programming language, including: Pre-defined development environment and design rules; Based on the aforementioned development environment and design rules, I / O layer code was written in C language; The data I / O layer is generated based on the I / O layer code, and the data I / O layer is configured in the application environment of the hardware device.

3. The data processing method for developing drivers based on a scripting language according to claim 1, characterized in that, Receiving reported data from the hardware device and sending the reported data to the runtime of the scripting language through the data I / O layer includes: Receive reported data from the hardware device via serial port; The data I / O layer receives the reported data and reads the reported data to obtain the source data in the reported data; The source data is sent and written to the runtime of the scripting language to prepare for driver execution, wherein the application subject for driver execution is the scripting language application.

4. The data processing method for developing drivers based on a scripting language according to claim 3, characterized in that, Before receiving reported data from the hardware device and sending the reported data to the runtime of the scripting language through the data I / O layer, the method further includes: The serial port is monitored by a preset C program, and it is determined whether the serial port has a response: if the serial port has a response, the reported data from the hardware device is received through the data I / O layer. The C program reads the reported data, sends it as driving data, and writes it into the runtime of the scripting language.

5. An apparatus for implementing the data processing method for developing driver programs based on scripting languages ​​according to any one of claims 1-4, characterized in that, include: A data I / O layer construction module is used to write a data I / O layer using a preset programming language, wherein the data I / O layer is used to input / output data from hardware devices; The runtime environment configuration module is used to configure the runtime of the scripting language and connect the runtime of the scripting language to the data I / O layer; The data reporting module is used to receive reported data from the hardware device and send the reported data to the runtime of the scripting language through the data I / O layer; The driver execution module is used to receive reported data and process the data during the runtime of the scripting language, and return the execution result.

6. The apparatus according to claim 5, characterized in that, The runtime environment configuration module includes: The script code writing module is used to write script code based on a scripting language; The runtime setup module is used to introduce the runtime environment and corresponding reference libraries required by the script code, and to build the runtime of the script language through the runtime environment and the reference libraries; The scripting language application module is used to write the script code into the runtime of the scripting language to obtain the scripting language application as a driver, and to interface the scripting language application with the data I / O layer.

7. The apparatus according to claim 6, characterized in that, The data reporting module includes: A data receiving serial port is used to receive reported data from the hardware device via a serial port. The reading module is used by the data I / O layer to receive the reported data and read the reported data to obtain the source data in the reported data; The driver preparation module is used to send the source data and write it into the runtime of the scripting language to prepare for driver execution, wherein the application subject of the driver execution is the scripting language application. The serial port monitoring module is used to monitor the serial port through a preset C program and determine whether the serial port has a response. If the serial port has a response, the module receives the reported data from the hardware device through the data I / O layer. The C program reads the reported data, sends it as driver data, and writes it into the runtime of the scripting language.

8. The apparatus according to claim 7, characterized in that, The drive execution module includes: The driver data processing module is configured to receive the driver data; and, through the scripting language application, read the driver data from the C program and write data into the C program to complete the driver data processing and obtain the execution result—a data variable; and, return the data variable to the hardware device through the data I / O layer that is connected to the runtime of the scripting language.

Citation Information

Patent Citations

  • Embeded system based on script programming language and operation method thereof

    KR1020110108143A