Batch data read-write method, device and equipment in Baifu development environment and medium
By using the method of obtaining and mapping virtual addresses as physical addresses in the Beckhoff development environment, the resource consumption and real-time problems during batch data reading and writing are solved, and fast data exchange and efficient resource utilization are achieved.
Patent Information
- Application Number
- CN202510291394.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-07-18
AI Technical Summary
In Beckhoff's development environment, the prior art has high resource consumption and reduced real-time performance due to large amounts of data when reading and writing batch data.
The batch data operation request of the user process is obtained through the kernel state in the computer operating system, and the operation and processing is performed based on the virtual address mapping. The fast access characteristics of the kernel state are used to avoid the resource consumption and real-time problems of traditional ADS technology.
It realizes rapid reading and writing data when the data volume is large, improves the real-time performance of the Beckhoff control system and reduces resource consumption.
Smart Images

Figure CN120336206A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, device, equipment, and medium for batch data reading and writing in the Beckhoff development environment. Background Art
[0002] The Beckhoff development environment is generally applicable to the research and development of products with high requirements for stability and real-time performance. For example, related products in industries such as industrial numerical control and medical robots. The biggest feature of such products in the industrial field or medical field is the need to communicate with other systems or devices. Such communication generally refers to the communication of user-level application systems, and the Automation Device Specification (ADS) technology adopted by the Beckhoff control system during communication is implemented based on the TCP / IP protocol, which is a reliable and mature data exchange solution in a network environment.
[0003] Traditionally, in a communication scenario with a large amount of data exchange, since the ADS technology has certain requirements for the amount of data during batch data reading and writing, if the amount of data is too large, it will consume a large amount of resources and reduce the real-time performance of the Beckhoff control system. Summary of the Invention
[0004] This application aims to at least solve the technical problems existing in the prior art. To this end, a first aspect of this application proposes a method for batch data reading and writing in the Beckhoff development environment, and the method includes:
[0005] Obtain a batch data operation request sent by a user process through the kernel state in the computer operating system; the batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on the virtual address corresponding to the user process;
[0006] Access a kernel object based on the batch data operation request, and map the virtual address to a physical address;
[0007] Perform operation processing on the batch data based on the physical address.
[0008] In a possible implementation manner, accessing a kernel object based on the batch data operation request and mapping the virtual address to a physical address includes:
[0009] Based on the batch data operation request, obtain the Twin CAT process in the Beckhoff development environment through the kernel state;
[0010] Access a kernel object based on the virtual address and the Twin CAT process, and map the virtual address to a physical address.
[0011] In a possible implementation manner, the method further includes:
[0012] Send a virtual address request through the user process;
[0013] Receive the virtual address request through the Twin CAT process, and obtain the virtual address based on the virtual address request;
[0014] Return the virtual address to the user process.
[0015] In a possible implementation manner, the method further includes:
[0016] Receive the virtual address through the user process;
[0017] Generate a batch data operation request based on the virtual address.
[0018] In a possible implementation manner, the batch data operation request includes a batch data read request, and perform operation processing on the batch data based on the physical address, including:
[0019] Return the physical address to the user process through the kernel mode to perform read processing on the batch data.
[0020] In a possible implementation manner, the batch data operation request includes a batch data write request, and perform operation processing on the batch data based on the physical address, including:
[0021] Return the physical address to the user process through the kernel mode to perform write processing on the batch data.
[0022] A second aspect of this application proposes a batch data reading and writing device in a Beckhoff development environment, and the device includes:
[0023] An acquisition module, configured to obtain a batch data operation request sent by a user process through the kernel mode in a computer operating system; the batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on a virtual address corresponding to the user process;
[0024] A mapping module, configured to access a kernel object based on the batch data operation request, and map the virtual address to a physical address;
[0025] A processing module, configured to perform operation processing on the batch data based on the physical address.
[0026] In a possible implementation manner, the above mapping module is specifically configured to:
[0027] Obtain the Twin CAT process in the Beckhoff development environment through the kernel mode based on the batch data operation request;
[0028] Access the kernel object based on the virtual address and the Twin CAT process, and map the virtual address to a physical address.
[0029] In a possible implementation, the batch data reading and writing device in the above Beckhoff development environment is further configured to:
[0030] Send a virtual address request through the user process;
[0031] Receive the virtual address request through the Twin CAT process, and obtain the virtual address based on the virtual address request;
[0032] Return the virtual address to the user process.
[0033] In a possible implementation, the batch data reading and writing device in the above Beckhoff development environment is further configured to:
[0034] Receive the virtual address through the user process;
[0035] Generate a batch data operation request based on the virtual address.
[0036] In a possible implementation, the batch data operation request includes a batch data read request, and the batch data reading and writing device in the above Beckhoff development environment is further configured to:
[0037] Return the physical address to the user process through the kernel mode to perform read processing on the batch data.
[0038] In a possible implementation, the batch data operation request includes a batch data write request, and the above processing module is specifically configured to:
[0039] Return the physical address to the user process through the kernel mode to perform write processing on the batch data.
[0040] A third aspect of this application proposes an electronic device, which includes a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the batch data reading and writing method in the Beckhoff development environment as described in the first aspect.
[0041] A fourth aspect of this application proposes a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the batch data reading and writing method in the Beckhoff development environment as described in the first aspect.
[0042] The fifth aspect of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the method for batch data reading and writing in the Beckhoff development environment described in the first aspect above.
[0043] The embodiments of the present application have the following beneficial effects:
[0044] The method for batch data reading and writing in the Beckhoff development environment provided by the embodiments of the present application includes: obtaining a batch data operation request sent by a user process through the kernel mode in the computer operating system. The batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on the virtual address corresponding to the user process. Access the kernel object based on the batch data operation request, and map the virtual address to a physical address. Based on the physical address, perform operation processing on the batch data. When data interaction is performed through the kernel mode in this solution, since the access time for accessing the kernel object can be ignored, therefore, the time consumed during batch data reading and writing is only the time for obtaining the virtual address, that is, the time for one ADS communication, thus avoiding the problems existing in the prior art of batch reading and writing data through the ADS technology. Using this method can quickly read and write data when the data volume is large, improving the real-time performance of the Beckhoff control system, and at the same time avoiding the consumption of a large amount of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a block diagram of a computer device provided by an embodiment of the present application;
[0046] Figure 2 It is a step flowchart of a method for batch data reading and writing in the Beckhoff development environment provided by an embodiment of the present application;
[0047] Figure 3 It is a schematic diagram of a paging mechanism of an operating system provided by an embodiment of the present application;
[0048] Figure 4 It is a step flowchart of a method for obtaining a virtual address provided by an embodiment of the present application;
[0049] Figure 5 It is a step flowchart of a method for obtaining a virtual address provided by an embodiment of the present application;
[0050] Figure 6 It is a step flowchart of a method for mapping a virtual address to a physical address provided by an embodiment of the present application;
[0051] Figure 7 It is an overall flowchart of a method for batch data reading and writing in the Beckhoff development environment provided by an embodiment of the present application;
[0052] Figure 8The block diagram of a batch data reading and writing device in the Beckhoff development environment provided by the embodiments of the present application. Specific embodiments
[0053] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0054] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present disclosure, unless otherwise stated, the meaning of "plurality" is two or more. Additionally, the use of "based on" or "in accordance with" is meant to be open and inclusive, as a process, step, calculation, or other action based on or in accordance with one or more of the stated conditions or values may, in practice, be based on additional conditions or values beyond those stated.
[0055] The batch data reading and writing method in the Beckhoff development environment provided by the present application can be applied to a computer device (electronic device). The computer device can be a server or a terminal. Among them, the server can be a single server or a server cluster composed of multiple servers. The embodiments of the present application do not make specific limitations in this regard. The terminal can be, but is not limited to, various personal computers, laptop computers, smartphones, tablet computers, and portable wearable devices.
[0056] Taking the computer device as a server as an example, Figure 1 A block diagram of a server is shown. As Figure 1 shown, the server may include a processor and a memory connected through a system bus. Among them, the processor of the server is used to provide computing and control capabilities. The memory of the server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a batch data reading and writing method in the Beckhoff development environment is implemented.
[0057] Those skilled in the art can understand, Figure 1The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the server to which the solution of this application is applied. Optionally, the server may include more or fewer components than those shown in the figure, or combine some components, or have a different component arrangement.
[0058] It should be noted that the execution subject of the embodiments of this application can be a computer device or a batch data reading and writing device in the Beckhoff development environment. In the following method embodiments, the computer device is used as the execution subject for description.
[0059] Figure 2 This is a step flowchart of a batch data reading and writing method in the Beckhoff development environment provided by the embodiments of this application. As Figure 2 shown, the method includes the following steps:
[0060] Step 202: Obtain a batch data operation request sent by a user process through the kernel state in the computer operating system.
[0061] Among them, the Beckhoff development environment is generally applicable to the research and development of products with high requirements for stability and real-time performance. For example, related products in industries such as industrial numerical control and medical robots. The biggest feature of these products in the industrial site or medical site is the need to communicate with other systems or devices. The application scenarios of this application can include various ones. For example, the scenario where the UI application software of a medical robot reads the joint information of the robot in real time. Another example is the scenario where key diagnostic data needs to be obtained when diagnosing and analyzing occasional fault problems of related products. Of course, it can also be applied to other scenarios. The embodiments of this application do not make specific limitations on this.
[0062] In the Beckhoff development environment, Beckhoff runtime data is maintained by a separate process. To solve the problem of low data exchange efficiency, it is necessary to explore the way of data interaction between the Twin CAT process and other external processes. Among them, Twin CAT is a set of automation software platforms that implements a real-time extension of the Windows system kernel scheduling mechanism and has characteristics such as real-time feasible scheduling, parallel execution of processes, and direct access to hardware resources to meet the real-time requirements of industrial control.
[0063] Currently, common methods between processes include Socket, pipes, and shared memory, etc. However, since the Beckhoff development environment is a relatively closed environment and does not provide these basic methods. Based on this, this application proposes a data interaction method based on the kernel state, enabling efficient and reliable batch data interaction between processes.
[0064] As we know from the principles of the Windows operating system, all Twin CAT processes actually complete their work by calling services with the same name in the Windows kernel, that is, the resources of the process are a Windows kernel object. Among them, the kernel object is a memory block in the system address space, created and maintained by the system. This memory object is a data structure that maintains information related to the object.
[0065] In addition, the kernel object is owned by the kernel, not by the process, so different processes can access the same kernel object. In kernel mode, through the read information address or name information set by the user in advance, and by borrowing the necessary kernel objects that can be accessed, the batch data interaction is completed, and then returned to the user process through the driver interface, and finally the data interaction is completed.
[0066] When implementing the batch data reading and writing based on kernel mode, it is necessary to first develop the Windows driver program, so that the developed Windows driver program can be installed on the Beckhoff industrial computer, and in this driver program, the kernel-mode data interaction can be used to replace the ADS batch data reading and writing.
[0067] Specifically, when developing the Windows driver program, the feasibility and reliability plan for batch data exchange between processes can be determined first. This plan is to parse the register address in kernel mode and obtain a process that can safely read and write kernel mode. In addition, the Windows Driver Framework (WDF) can be used to develop the Windows driver program.
[0068] Next, multiple entities involved in data interaction need to be sorted out, which can include user processes, Twin CAT processes, and kernel-mode processes. The kernel-mode process is also the driver. And the interaction parameters of each entity during the operation process also need to be sorted out, which can include but are not limited to the handle of the user process, the handle of the kernel-mode process, the resource list of the kernel object, the physical address of the CR3 register, etc.
[0069] Thus, the driver program can be developed based on the above information, that is, the kernel-mode process is developed. After the final development, it is an installable driver program and the corresponding user manual. Among them, the user manual refers to the technical manual, which can tell the user how to use the driver program in the user process to obtain the data in kernel mode. Finally, a test user process also needs to be written to complete the verification of the plan.
[0070] After the above Window driver is developed, when performing batch data reading and writing in the Beckhoff development environment, it is necessary to first obtain the batch data operation request sent by the user process through the kernel mode in the operating system. Among them, the batch data operation request can include a batch data read request or a batch data write request, and the batch data operation request is generated based on the virtual address corresponding to the user process.
[0071] In some alternative embodiments, the above virtual address is determined by the paging mechanism of the operating system, such as Figure 3 shown Figure 3 is a schematic diagram of a paging mechanism of an operating system provided by an embodiment of the present application. Among them, a page directory has 1024 entries, each entry occupies 4 bytes, and each entry manages 1 page table PTE. There are a total of 1024 page tables, each page table has 1024 entries, each entry occupies 4 bytes, and each entry manages 1 page PAGE. The 4GB virtual address space is divided into 0x100000 pages, and each page is 4096 bytes.
[0072] The virtual address can be obtained from the Twin CAT process through a virtual address request, such as Figure 4 shown Figure 4 is a flowchart of steps for obtaining a virtual address provided by an embodiment of the present application, including:
[0073] Step 402: Send a virtual address request through the user process.
[0074] Step 404: Receive the virtual address request through the Twin CAT process, and obtain the virtual address based on the virtual address request.
[0075] Step 406: Return the virtual address to the user process.
[0076] Among them, when performing batch data reading and writing, the user process can request ADS to obtain the virtual address of the variable, that is, it can first send a virtual address request to the Twin CAT process. After the Twin CAT process receives the virtual address request, it can obtain the virtual address based on the virtual address request and return the virtual address to the user process.
[0077] Next, after the user process receives the virtual address returned by the Twin CAT process, it can generate a batch data operation request, such as Figure 5 shown Figure 5 is a flowchart of steps for obtaining a virtual address provided by an embodiment of the present application, including:
[0078] Step 502: Receive the virtual address through the user process.
[0079] Step 504: Generate a batch data operation request based on the virtual address.
[0080] Among them, after the user process receives the virtual address returned by the Twin CAT process, it can generate a batch data operation request based on the virtual address. The batch data operation request carries the corresponding virtual address, so that when data interaction is performed in the kernel mode, the virtual address can be mapped to the physical address corresponding to the variable, thereby realizing the reading and writing of batch data.
[0081] Step 204: Access the kernel object based on the batch data operation request and map the virtual address to a physical address.
[0082] Among them, when the kernel mode receives the batch data operation request sent by the user process, as Figure 6 shown, Figure 6 FIG. is a flowchart of steps for mapping a virtual address to a physical address provided by an embodiment of the present application, including:
[0083] Step 602: Obtain the Twin CAT process in the Beckhoff development environment through the kernel mode based on the batch data operation request.
[0084] Step 604: Access the kernel object based on the virtual address and the Twin CAT process and map the virtual address to a physical address.
[0085] Among them, after the kernel mode receives the batch data operation request, it can first obtain the corresponding Twin CAT process in the Beckhoff development environment through the kernel mode, that is, obtain the Twin CAT PROCESS. Then, it can access the kernel object based on the virtual address and the TwinCAT process and map the virtual address to a physical address.
[0086] The kernel object can be the CR3 kernel object, that is, the CR3 register. Since the CR3 register stores the physical address of the page directory, the virtual address can be mapped to the corresponding physical address by accessing the CR3 register. Since the access time of the register can be ignored, the efficiency of obtaining batch data is higher.
[0087] Step 206: Operate and process the batch data based on the physical address.
[0088] Among them, in some optional embodiments, when the batch data operation request includes a batch data read request, when operating and processing the batch data based on the physical address, the physical address can be returned to the user process through the kernel mode to perform read processing on the batch data.
[0089] In some alternative embodiments, when the batch data operation request includes a batch data write request and the batch data is operated and processed based on the physical address, the physical address can be returned to the user process through the kernel mode to perform the write process on the batch data.
[0090] This application provides a method for reading and writing batch data in a Beckhoff development environment. The method includes: obtaining, through the kernel mode in the computer operating system, a batch data operation request sent by a user process. The batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on the virtual address corresponding to the user process. Access the kernel object based on the batch data operation request, and map the virtual address to a physical address. Based on the physical address, perform operation and processing on the batch data. When data interaction is performed through the kernel mode in this solution, since the access time for accessing the kernel object can be ignored, therefore, the time consumed during batch data reading and writing is only the time for obtaining the virtual address, that is, the time for one ADS communication, thus avoiding the problems existing in the prior art when batch reading and writing data through the ADS technology. Using this method can quickly read and write data when the data volume is large, improving the real-time performance of the Beckhoff control system and also avoiding the consumption of a large amount of resources.
[0091] Figure 7 FIG. 7 is an overall flowchart of a method for reading and writing batch data in a Beckhoff development environment provided by an embodiment of this application. Among them, taking the batch data operation request as a batch data read request as an example for illustration, finally, after accessing the CR3 kernel object, a batch data pointer can be returned to the user process, and finally the user process can read the corresponding batch data. When data interaction is performed through the kernel mode in this application, since the access time for accessing the kernel object can be ignored, therefore, the time consumed during batch data reading and writing is only the time for obtaining the virtual address, that is, the time for one ADS communication, thus avoiding the problems existing in the prior art when batch reading and writing data through the ADS technology. Using this method can quickly read and write data when the data volume is large, improving the real-time performance of the Beckhoff control system and also avoiding the consumption of a large amount of resources.
[0092] Figure 8 FIG. 11 is a structural block diagram of a device for reading and writing batch data in a Beckhoff development environment provided by an embodiment of this application.
[0093] As Figure 8 shown, the device 800 for reading and writing batch data in this Beckhoff development environment includes:
[0094] An obtaining module 802, configured to obtain, through the kernel mode in the computer operating system, a batch data operation request sent by a user process; the batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on the virtual address corresponding to the user process.
[0095] A mapping module 804, configured to access a kernel object based on a batch data operation request and map a virtual address to a physical address.
[0096] A processing module 806, configured to perform operation processing on batch data based on the physical address.
[0097] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein. Each module in the batch data reading and writing device in the above Beckhoff development environment can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in a processor in a computer device in hardware form or be independent of the processor, or can be stored in a memory in a computer device in software form, so as to facilitate the processor to call and execute the operations of the above modules.
[0098] In an embodiment of the present application, a computer device is provided. The computer device includes a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0099] Obtain a batch data operation request sent by a user process through the kernel mode in a computer operating system; the batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on a virtual address corresponding to the user process;
[0100] Access a kernel object based on the batch data operation request and map the virtual address to a physical address;
[0101] Perform operation processing on the batch data based on the physical address.
[0102] In an embodiment of the present application, when the processor executes the computer program, the following steps are further implemented:
[0103] Obtain a Twin CAT process in the Beckhoff development environment through the kernel mode based on the batch data operation request;
[0104] Access a kernel object based on the virtual address and the Twin CAT process and map the virtual address to a physical address.
[0105] In an embodiment of the present application, when the processor executes the computer program, the following steps are further implemented:
[0106] Send a virtual address request through the user process;
[0107] Receive the virtual address request through the Twin CAT process and obtain the virtual address based on the virtual address request;
[0108] Return the virtual address to the user process.
[0109] In an embodiment of the present application, when the processor executes the computer program, the following steps are further implemented:
[0110] Receive a virtual address through the user process;
[0111] Generate a batch data operation request based on the virtual address.
[0112] In an embodiment of the present application, the batch data operation request includes a batch data read request. When the processor executes the computer program, the following steps are further implemented:
[0113] Return the physical address to the user process through the kernel mode to perform read processing on the batch data.
[0114] In an embodiment of the present application, the batch data operation request includes a batch data write request. When the processor executes the computer program, the following steps are further implemented:
[0115] Return the physical address to the user process through the kernel mode to perform write processing on the batch data.
[0116] The computer device provided by the embodiment of the present application has the same implementation principle and technical effects as the above method embodiment, which will not be elaborated here.
[0117] In an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0118] Obtain a batch data operation request sent by the user process through the kernel mode in the computer operating system; the batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on the virtual address corresponding to the user process;
[0119] Access the kernel object based on the batch data operation request and map the virtual address to the physical address;
[0120] Perform operation processing on the batch data based on the physical address.
[0121] In an embodiment of the present application, when the computer program is executed by the processor, the following steps are further implemented:
[0122] Obtain the Twin CAT process in the Beckhoff development environment through the kernel mode based on the batch data operation request;
[0123] Access the kernel object based on the virtual address and the Twin CAT process and map the virtual address to the physical address.
[0124] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0125] Send a virtual address request through the user process;
[0126] Receive the virtual address request through the Twin CAT process, and obtain the virtual address based on the virtual address request;
[0127] Return the virtual address to the user process.
[0128] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0129] Receive the virtual address through the user process;
[0130] Generate a batch data operation request based on the virtual address.
[0131] In one embodiment of the present application, the batch data operation request includes a batch data read request. When the computer program is executed by a processor, the following steps are further implemented:
[0132] Return the physical address to the user process through the kernel mode to perform read processing on the batch data.
[0133] In one embodiment of the present application, the batch data operation request includes a batch data write request. When the computer program is executed by a processor, the following steps are further implemented:
[0134] Return the physical address to the user process through the kernel mode to perform write processing on the batch data.
[0135] The computer-readable storage medium provided in this embodiment has the same implementation principle and technical effects as the above method embodiment, and will not be elaborated here.
[0136] In one embodiment of the present application, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0137] Obtain the batch data operation request sent by the user process through the kernel mode in the computer operating system; the batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on the virtual address corresponding to the user process;
[0138] Access the kernel object based on the batch data operation request, and map the virtual address to the physical address;
[0139] Perform operation processing on the batch data based on the physical address.
[0140] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0141] Based on a batch data operation request, obtain the Twin CAT process in the Beckhoff development environment through the kernel mode;
[0142] Access the kernel object based on the virtual address and the Twin CAT process, and map the virtual address to a physical address.
[0143] In an embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0144] Send a virtual address request through the user process;
[0145] Receive the virtual address request through the Twin CAT process, and obtain the virtual address based on the virtual address request;
[0146] Return the virtual address to the user process.
[0147] In an embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0148] Receive the virtual address through the user process;
[0149] Generate a batch data operation request based on the virtual address.
[0150] In an embodiment of the present application, the batch data operation request includes a batch data read request. When the computer program is executed by a processor, the following steps are further implemented:
[0151] Return the physical address to the user process through the kernel mode to perform read processing on the batch data.
[0152] In an embodiment of the present application, the batch data operation request includes a batch data write request. When the computer program is executed by a processor, the following steps are further implemented:
[0153] Return the physical address to the user process through the kernel mode to perform write processing on the batch data.
[0154] The computer program product provided in this embodiment has the same implementation principle and technical effects as the above method embodiment, and will not be described in detail here.
[0155] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above various methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0156] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0157] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A method for batch data reading and writing in the Beckhoff development environment, characterized in that, The method includes: Obtaining a batch data operation request sent by a user process through the kernel mode in a computer operating system; the batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on the virtual address corresponding to the user process; Accessing a kernel object based on the batch data operation request and mapping the virtual address to a physical address; Performing operation processing on the batch data based on the physical address.
2. The method according to claim 1, wherein The accessing a kernel object based on the batch data operation request and mapping the virtual address to a physical address includes: Obtaining a Twin CAT process in the Beckhoff development environment through the kernel mode based on the batch data operation request; Accessing the kernel object based on the virtual address and the Twin CAT process and mapping the virtual address to a physical address.
3. The method according to claim 2, wherein The method further includes: Sending a virtual address request through the user process; Receiving the virtual address request through the Twin CAT process and obtaining the virtual address based on the virtual address request; Returning the virtual address to the user process.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Receiving the virtual address through the user process; Generating the batch data operation request based on the virtual address.
5. The method according to any one of claims 1 to 3, characterized in that The batch data operation request includes a batch data read request, and the performing operation processing on the batch data based on the physical address includes: Returning the physical address to the user process through the kernel mode to perform read processing on the batch data.
6. The method according to any one of claims 1 to 3, characterized in that, The batch data operation request includes a batch data write request, and the performing operation processing on the batch data based on the physical address includes: Returning the physical address to the user process through the kernel mode to perform write processing on the batch data.
7. A batch data reading and writing device in the Beckhoff development environment, characterized in that, The device includes: An obtaining module, configured to obtain a batch data operation request sent by a user process through the kernel mode in a computer operating system; the batch data operation request includes a batch data read request or a batch data write request, and the batch data operation request is generated based on the virtual address corresponding to the user process; A mapping module, configured to access a kernel object based on the batch data operation request and map the virtual address to a physical address; A processing module, configured to perform operation processing on the batch data based on the physical address.
8. An electronic device, characterized in that, The electronic device includes a processor and a memory, and at least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the steps of the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, At least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the steps of the method according to any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.