Variable reading and writing method and device and readable storage medium

By determining the variable storage address in the application and sending read and write packets, the problem that the upper computer cannot flexibly select variables for reading and writing is solved, and flexible reading and writing and monitoring of application variables is realized, and debugging and monitoring efficiency is improved.

CN119166033APending Publication Date: 2024-12-20CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1
View PDF 0 Cites -1 Cited by

Patent Information

Application Number
CN202310737206.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In the prior art, the upper computer cannot flexibly select variables in the lower computer application for reading and writing according to user needs. Due to the limitations of communication protocols and applications, it cannot meet the user's reading and writing needs for variables.

Method used

By determining the variable to be read and written in the application and obtaining its storage address, the read and write packets including the storage address are sent to the lower computer, so that the lower computer can read and write according to the storage address, and decoupling with the communication protocol and the application program is achieved. , allowing the upper computer to flexibly select variables for reading and writing.

Benefits of technology

It realizes flexible reading and writing of variables in the application, meets different debugging and monitoring needs, and improves the flexibility and efficiency of application debugging and monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166033A_ABST
    Figure CN119166033A_ABST
Patent Text Reader

Abstract

The invention provides a variable reading and writing method and device and a readable storage medium, and relates to the technical field of software. The method comprises the following steps: determining a variable to be read and written from a plurality of variables of an application program, determining a storage address of the variable to be read and written in a lower computer, then sending a read-write message comprising the storage address to the lower computer, and enabling the lower computer to read and write the variable to be read and written according to the storage address in the read-write message, therefore, the variables in the application program can be flexibly selected for reading and writing, and the reading and writing requirements of a user on the variables can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software technology, and in particular to a variable reading and writing method, device and readable storage medium. Background Art

[0002] The variables in the application are quantities that can be changed during the operation of the application. The upper computer can read and write one or more variables in the application running on the lower computer to monitor and control the application. For example, during the debugging stage of the application, the upper computer can change one or more variables in the application through write operations during the operation of the application to change the running state of the application and troubleshoot errors and exceptions in the application during operation.

[0003] In the related art, due to the limitations of the communication protocol between the upper computer and the lower computer and the application program, the lower computer may only support the upper computer to read and write some variables in the application program, making it impossible for the upper computer to flexibly select variables in the application program for reading and writing according to user needs, and unable to meet the user's needs for reading and writing variables. Therefore, providing a method for flexibly selecting variables for reading and writing has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present application provide a variable reading and writing method, device and readable storage medium, which can meet the user's needs for reading and writing variables.

[0005] In a first aspect, a variable reading and writing method is provided, the method comprising:

[0006] Determining a first variable to be read or written from a plurality of variables of an application program installed on a lower computer;

[0007] Obtaining a first storage address of the first variable in the lower computer;

[0008] A read / write message including the first storage address is sent to the lower computer, wherein the read / write message is used to enable the lower computer to read and write the first variable according to the first storage address.

[0009] During the variable reading and writing process, the host computer first determines the storage address of the variable in the slave computer, and then directly reads and writes the data stored in the memory unit according to the storage address to complete the reading and writing of the variable. During the variable reading and writing process, the host computer can complete the reading and writing of the variable by transmitting the read and write message including the storage address through the communication protocol, and there is no need to identify the variable based on the communication protocol. At the same time, there is no need for the application to access the memory unit based on the variable, and the reading and writing process can be decoupled from the application, so that the variable reading and writing process is not restricted by the communication protocol and the application, so that the host computer can flexibly select the variables in the application for reading and writing, and thus meet the user's reading and writing needs for the variable.

[0010] Since the host computer can flexibly select variables in the application to read and write according to the needs, during the debugging stage of the application, the host computer can flexibly change one or more variables in the application according to the debugging needs, which can meet different debugging needs. During the running stage of the application, the host computer can flexibly select variables in the application to read and write according to the monitoring needs, and can monitor the running process of the application more flexibly.

[0011] In some embodiments, the application is installed in a first plug-in among multiple plug-ins included in the lower computer, and the read-write message includes a plug-in identifier of the first plug-in, and the plug-in identifier is used to enable the lower computer to read and write the first variable through the first plug-in.

[0012] In an embodiment of the present application, the upper computer sends a read-write message including a storage address and a plug-in identifier to the lower computer, so that the lower computer can determine the plug-in in which the variable is located according to the plug-in identifier, and read and write the variable through the plug-in, thereby being able to read and write the variables in any plug-in included in the lower computer to meet the user's needs for reading and writing variables in different plug-ins.

[0013] In some embodiments, obtaining the first storage address of the first variable in the lower computer includes: obtaining the first storage address from an address mapping file, wherein the address mapping file includes the multiple variables and the storage address of each variable in the lower computer.

[0014] In an embodiment of the present application, the host computer can obtain the address mapping file of the application in advance. After determining the variables to be read and written, the storage address of the variables to be read and written can be determined from the address mapping file, and the storage address of the variables can be determined quickly and accurately.

[0015] In some embodiments, before obtaining the first storage address from the address mapping file, the method further includes: compiling a source program of the application program, and generating the address mapping file according to storage addresses allocated to the multiple variables during the compilation process.

[0016] In the embodiment of the present application, the host computer obtains the address mapping file of the application by compiling the source program of the application, and can accurately and completely obtain the variables included in the application and the storage address of each variable.

[0017] In some embodiments, determining the first variable to be read or written from a plurality of variables of the application program includes:

[0018] displaying the plurality of variables;

[0019] In response to the input selection instruction, the first variable is determined from the plurality of variables.

[0020] In an embodiment of the present application, the host computer can display multiple variables included in the application, so that the user can select variables from the multiple variables for reading and writing according to needs, which can facilitate the user to quickly determine the variables to be read and written, thereby improving the efficiency of variable reading and writing.

[0021] In some embodiments, the application is installed in a first plug-in among a plurality of plug-ins included in the lower computer, and the method further comprises: indicating by displaying a plug-in identification of the first plug-in that the plurality of variables displayed are stored in the first plug-in.

[0022] In an embodiment of the present application, when the lower computer includes multiple plug-ins, the upper computer displays the plug-in identifier of the plug-in when displaying the variables stored in the plug-in. The plug-in identifier can indicate the plug-in in which the variable is located, which can facilitate the user to select variables in different plug-ins for reading and writing.

[0023] In some embodiments, the method further includes: receiving a read-write result sent by the lower computer after reading and writing the first variable according to the read-write message; and displaying the read-write result.

[0024] In an embodiment of the present application, after the upper computer reads and writes the variables in the application installed in the lower computer, it receives and displays the read and write results sent by the lower computer, so that the user can know the read and write results in time and judge whether there is any abnormality in the read and write process based on the read and write results.

[0025] In a second aspect, a variable reading and writing method is provided, which is applied to a lower computer, and the method includes:

[0026] Receiving a read / write message sent by a host computer, wherein the read / write message includes a first storage address of a first variable in the slave computer, and the first variable is one of a plurality of variables included in an application program of the slave computer;

[0027] The first variable is read and written according to the first storage address.

[0028] In some embodiments, the read / write message includes a plug-in identifier, and the reading and writing of the first variable according to the first storage address includes:

[0029] Determine a first plug-in corresponding to the plug-in identifier from a plurality of plug-ins included in the lower computer;

[0030] The first variable is read and written through the first plug-in.

[0031] In some embodiments, the method further includes: sending to the host computer a reading and writing result obtained after reading and writing the first variable.

[0032] In a third aspect, a variable reading and writing device is provided, the device comprising:

[0033] A determination module, used for determining a first variable to be read or written from a plurality of variables of an application program, wherein the application program is installed on a lower computer;

[0034] An acquisition module, used for acquiring a first storage address of the first variable in the lower computer;

[0035] A sending module is used to send a read-write message including the first storage address to the lower computer, and the read-write message is used to enable the lower computer to read and write the first variable according to the first storage address.

[0036] In some embodiments, the application is installed in a first plug-in among multiple plug-ins included in the lower computer, and the read-write message includes a plug-in identifier of the first plug-in, and the plug-in identifier is used to enable the lower computer to read and write the first variable through the first plug-in.

[0037] In some embodiments, the acquisition module is specifically used to acquire the first storage address from an address mapping file, where the address mapping file includes the multiple variables and the storage address of each variable in the lower computer.

[0038] In some embodiments, the apparatus further comprises: a compiling module, configured to compile a source program of the application program, and generate the address mapping file according to storage addresses allocated to the plurality of variables during the compiling process.

[0039] In some embodiments, the determination module is specifically configured to display the plurality of variables; and determine the first variable from the plurality of variables in response to an input selection instruction.

[0040] In some embodiments, the apparatus further comprises: a display module, configured to indicate that the plurality of variables displayed are stored in the first plug-in by displaying a plug-in identification of the first plug-in.

[0041] In some embodiments, the device further includes: a display module, configured to receive a read / write result sent by the lower computer after reading and writing the first variable according to the read / write message; and display the read / write result.

[0042] In a fourth aspect, a variable reading and writing device is provided, which is arranged in a lower computer, and the device comprises:

[0043] A receiving module, used for receiving a read-write message sent by a host computer, wherein the read-write message includes a first storage address of a first variable in the slave computer, and the first variable is one of a plurality of variables included in an application program of the slave computer;

[0044] A read / write module is used to read and write the first variable according to the first storage address.

[0045] In some embodiments, the read / write message includes a plug-in identifier, and the read / write module is specifically used to determine a first plug-in corresponding to the plug-in identifier from a plurality of plug-ins included in the lower computer; and read and write the first variable through the first plug-in.

[0046] In some embodiments, the device further includes: a sending module, configured to send a reading and writing result obtained after reading and writing the first variable to the host computer.

[0047] In a fifth aspect, a readable storage medium is provided, on which a computer program is stored. When the computer program runs on a variable reading and writing device, the variable reading and writing device executes the variable reading and writing method provided in the first aspect or the second aspect.

[0048] In the sixth aspect, a variable reading and writing device is provided, comprising: a processor; a memory; and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the processor, the screening device executes the variable reading and writing method provided in the first aspect or the second aspect.

[0049] In a seventh aspect, a computer program product is provided, comprising: a computer program code, when the computer program code is run on a variable reading and writing device, the variable reading and writing device executes the variable reading and writing method provided in the first aspect or the second aspect.

[0050] In an eighth aspect, a chip is provided, comprising: a processor for calling and running a computer program from a memory, so that a variable reading and writing device equipped with the chip executes the variable reading and writing method provided in the first aspect or the second aspect.

[0051] It can be understood that the variable reading and writing devices provided in the third and fourth aspects, the readable storage medium provided in the fifth aspect, the computer program product provided in the sixth aspect, and the chip provided in the eighth aspect are all used to execute the variable reading and writing methods provided in the first or second aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A schematic diagram of a scenario of variable reading and writing provided in an embodiment of the present application is shown.

[0053] Figure 2 A flow chart of the steps of a variable reading and writing method provided in an embodiment of the present application is shown.

[0054] Figure 3 A schematic diagram of an interface during a variable reading and writing process provided in an embodiment of the present application is shown.

[0055] Figure 4 A schematic diagram of the composition of a control device provided in an embodiment of the present application is shown.

[0056] Figure 5 A flow chart of a variable reading and writing process provided in an embodiment of the present application is shown.

[0057] Figure 6 A schematic diagram of an interface in another variable reading and writing process provided in an embodiment of the present application is shown.

[0058] Figure 7 A schematic diagram of the structure of a variable reading and writing device provided in an embodiment of the present application is shown.

[0059] Figure 8 A schematic diagram of the structure of a variable reading and writing device provided in an embodiment of the present application is shown.

[0060] Fig. 9 A structural block diagram of a variable reading and writing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0061] The technical solution in the present application will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0062] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0063] The term "comprising" herein indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections. The terms "comprising", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized. Below, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise stated, the meaning of "multiple" is two or more.

[0064] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0065] A variable is a quantity that can be changed during the running of an application, and can refer to the input or output of an application. During the debugging and use phase of an application, it is often necessary to read and write variables in the application running on the slave computer through the host computer. Reading and writing variables means performing read or write operations on variables to read or change the variable value of the variable.

[0066] For example, during the development phase of an application, it is necessary to debug the application variables. During the variable debugging process, the host computer needs to read a variable in the application to determine whether the application is abnormal based on the variable value of the variable. Alternatively, the host computer may need to write to a variable to change the variable value of the variable, thereby changing the running state of the application and troubleshooting errors and abnormalities in the running process of the application.

[0067] For another example, during the use phase of the application, the host computer needs to monitor the running process of the application. The host computer needs to read one or more variables in the application from the slave computer and determine the running status of the application based on the variable values ​​of the read variables.

[0068] When the application is installed in the lower computer, the variables in the application are stored in the memory unit of the lower computer. During the compilation of the application, a corresponding memory unit is allocated to each variable in the application. During the running of the application, the variables are stored in the corresponding memory unit.

[0069] The communication between the upper computer and the lower computer depends on the communication protocol between the two, and the reading and writing process of variables also requires the participation of the application. Due to the limitations of the communication protocol and the application, the lower computer may only support the upper computer to read and write some variables in the application, making it impossible for the upper computer to flexibly select variables in the application for reading and writing according to user needs, and unable to meet the user's needs for reading and writing variables.

[0070] In order to solve the above technical problems, an embodiment of the present application provides a variable reading and writing method. During the variable reading and writing process, the upper computer first determines the variable to be read and written from multiple variables of the application, and determines the storage address of the variable to be read and written in the lower computer, and then sends a read-write message including the storage address to the lower computer. The lower computer reads and writes the variable to be read and written according to the storage address in the read-write message.

[0071] During the variable reading and writing process, the host computer first determines the storage address of the variable in the slave computer, and then directly reads and writes the data stored in the memory unit according to the storage address to complete the reading and writing of the variable. During the variable reading and writing process, the host computer can complete the reading and writing of the variable by transmitting the read and write message including the storage address through the communication protocol, and there is no need to identify the variable based on the communication protocol. At the same time, there is no need for the application to access the memory unit based on the variable, and the reading and writing process can be decoupled from the application, so that the variable reading and writing process is not restricted by the communication protocol and the application, so that the host computer can flexibly select the variables in the application for reading and writing, and thus meet the user's reading and writing needs for the variable.

[0072] Since the host computer can flexibly select variables in the application to read and write according to the needs, during the debugging stage of the application, the host computer can flexibly change one or more variables in the application according to the debugging needs, which can meet different debugging needs. During the running stage of the application, the host computer can flexibly select variables in the application to read and write according to the monitoring needs, and can monitor the running process of the application more flexibly.

[0073] Figure 1 A schematic diagram of a variable reading and writing scenario provided by an embodiment of the present application is shown. Figure 1As shown, the scenario includes a user 11, a host computer 12, a slave computer 13 and a controlled device 14. The host computer 12 is a computing device that can issue control instructions, such as a computer, a workstation, a server, a computer cluster, etc., but not limited thereto.

[0074] The lower computer 13 is a computing device that can control the controlled device 14 according to the control instructions issued by the upper computer 12 and obtain the status of the controlled device 14, such as a programmable logic controller (PLC), a microcontroller, an embedded system, and a control device composed of multiple embedded systems, etc., but not limited to these. The controlled device 14 can be specifically set according to different scenarios, for example, it can include Figure 1 The circulation pump 141, sensor 142, switch element 143, signal light 144 and fan 145 are shown, but are not limited to these.

[0075] like Figure 1 As shown, the lower computer 13 is in communication connection with the upper computer 12, and an application is installed in the lower computer 13. During the running of the application, the upper computer 12 can determine the first variable to be read and written from multiple variables of the application, determine the first storage address of the first variable in the lower computer 13, and then generate a read-write message including the first storage address, and send the read-write message to the lower computer 13.

[0076] Correspondingly, after receiving the read-write message sent by the upper computer 12, the lower computer 13 reads and writes the memory unit storing the first variable according to the first storage address in the read-write message, thereby realizing the reading and writing of the first variable.

[0077] Figure 2 A flow chart of the steps of a variable reading and writing method provided by an embodiment of the present application is shown. The method can be Figure 1 The upper computer 12 shown is implemented, including steps 21 to 23.

[0078] Step 21: Determine a first variable to be read or written from a plurality of variables of the application program.

[0079] Step 22: Obtain a first storage address of the first variable in the lower computer.

[0080] The application is installed in the lower computer, the first variable is one of multiple variables included in the application, and the first storage address is the address of a memory unit in the lower computer for storing the first variable.

[0081] Optionally, step 21 may include:

[0082] Display multiple variables in the application;

[0083] In response to the input selection instruction, a first variable is determined from a plurality of variables.

[0084] In some embodiments, the upper computer may pre-acquire an address mapping file of the application program, wherein the address mapping file includes variable names of multiple variables in the application program and a storage address of each variable in the lower computer.

[0085] During the variable reading and writing process, the host computer can obtain the variable name of each variable from the address mapping file and display the variable name of each variable. The user can determine the variable name of the first variable to be read and written from the displayed multiple variable names and input a selection instruction. The host computer can receive the selection instruction input by the user, and in response to the selection instruction, determine the variable name of the first variable from the multiple variable names, and then obtain the first storage address of the first variable from the address mapping file according to the variable name of the first variable.

[0086] Figure 3 FIG. 1 shows a schematic diagram of an interface in a variable reading and writing process provided by an embodiment of the present application. Figure 3 As shown, the host computer 12 can display a variable list 30, which includes variable names of N (N is an integer greater than 0) variables in the application program. The variable names are, for example, Figure 3 "Variable 1", "Variable 2", "Variable 3" and "Variable N" are shown.

[0087] At the same time, the host computer 12 can display a group of controls corresponding to each variable name, and the user can input selection instructions to the host computer 12 through the controls corresponding to the variable names. Figure 3 As shown, for the variable name “variable 1”, the host computer 12 can display the corresponding first control 31 , second control 32 , third control 33 , fourth control 34 and fifth control 35 .

[0088] Among them, the first control 31 can be a button for controlling the host computer 12 to perform a read operation on the variable. The second control 32 can be a display box for displaying the variable value read from the slave computer 13. The third control 33 can be a button for controlling the host computer 12 to perform a write operation on the variable. The fourth control 34 can be an input box for inputting a variable value. The fifth control 35 can be a display box for displaying the writing result of the variable. The control type and quantity corresponding to each variable name can include but are not limited to the above examples.

[0089] Exemplarily, the selection instruction may be a click instruction. When the user clicks the first control 31, the host computer 12 may determine the variable corresponding to the variable name "variable 1" as the first variable in response to the user's click operation. Then, the host computer 12 may determine the storage address corresponding to "variable 1" from the address mapping file, and determine the storage address corresponding to "variable 1" as the first storage address.

[0090] Similarly, when the user clicks the third control 33, the host computer 12 can determine the variable corresponding to the variable name "variable 1" as the first variable in response to the user's click operation. Then, the host computer 12 can determine the storage address corresponding to "variable 1" from the address mapping file, and determine the storage address corresponding to "variable 1" as the first storage address.

[0091] Before clicking the third control 33 , the user can input a variable value to the host computer 12 through the fourth control 34 , and the host computer 12 can use the variable value input by the user as the variable value of the first variable.

[0092] In other embodiments, the user may directly input the variable name of the first variable to the host computer 12 through the control, and the host computer 12 may determine the first storage address from the address mapping file according to the variable name of the first variable.

[0093] In other implementations, the host computer 12 may determine the first variable from multiple variables according to a preset rule, and determine the first storage address. For example, when it is necessary to randomly select a variable from multiple variables in the application program for reading and writing, the host computer 12 may randomly determine a variable corresponding to a variable name from multiple variable names in the address mapping file as the first variable, and determine the first storage address from the address mapping file.

[0094] The above are merely illustrative examples, and the method for the host computer to determine the first variable and the first storage address may include but is not limited to the above examples.

[0095] In an embodiment of the present application, the host computer can display multiple variables included in the application, so that the user can select variables from the multiple variables for reading and writing according to needs, which can facilitate the user to quickly determine the variables to be read and written, thereby improving the efficiency of variable reading and writing.

[0096] In an embodiment of the present application, the host computer can obtain the address mapping file of the application in advance. After determining the variables to be read and written, the storage address of the variables to be read and written can be determined from the address mapping file, and the storage address of the variables can be determined quickly and accurately.

[0097] Step 23: Send a read / write message including the first storage address to the lower computer.

[0098] The read-write message is used to enable the lower computer to read and write the first variable according to the first storage address.

[0099] For example, after the user clicks the first control 31, the host computer 12 can generate a read message in response to the user's click operation. Similarly, when the user clicks the third control 33, the host computer 12 can generate a write message in response to the user's click operation. Read messages and write messages are collectively referred to as read-write messages, which can also be referred to as downlink messages. The format of the read-write message is shown in the following table:

[0100] Table 1

[0101]

[0102] As shown in Table 1, the data of the first byte in the read / write message may be the relevant information that needs to be transmitted during the read / write process, the data of the second byte may be an operator, the data of the third to sixth bytes may be a first storage address, the data of the seventh byte may be a data type of the first variable, and the data of the eighth to M bytes may be a variable value of the first variable, where M is an integer greater than 8. The format of the read / write message may include, but is not limited to, the above examples.

[0103] Among them, when it is a read message, the operator in the second byte is a read operator, the read operator is, for example, 1, and the data of the 8th to M bytes can be empty. When it is a write message, the operator in the second byte is a write operator, the write operator is, for example, 0, and the data of the 8th to M bytes are the variable values ​​of the first variable. When the host computer 12 receives the user's click operation of clicking the third control 33, the data input in the fourth control 34 can be added to the 8th to M bytes in the write message.

[0104] In this embodiment, after receiving the read-write message sent by the upper computer, the lower computer can parse the read-write message and obtain the data included in the read-write message. When the read-write message is a read message, the lower computer can obtain the read operator and the first storage address from the read-write message. At this time, the lower computer can determine the memory unit corresponding to the first storage address from the memory of the lower computer, and read the data stored in the memory unit to obtain the variable value of the first variable.

[0105] When the read-write message is a write message, the lower computer can obtain the write operator, the first storage address and the variable value of the first variable from the read-write message. At this time, the lower computer can determine the memory unit corresponding to the first storage address from the memory of the lower computer, and write the variable value in the read-write message into the memory unit.

[0106] It should be noted that the first storage address can be a virtual address or a physical address. When the first storage address is a virtual address, the lower computer can first convert the virtual address into a physical address, and then read and write the memory unit indicated by the physical address. When the first storage address is a physical address, the lower computer can directly read and write the memory unit indicated by the first storage address.

[0107] In some embodiments, after the lower computer reads and writes the first variable and obtains the read and write result, it can send the read and write result to the upper computer. The upper computer can receive the read and write result sent by the lower computer and display the read and write result.

[0108] When a read operation is performed on the first variable, the read and write result is the variable value of the first variable. For example, after the lower computer reads the variable value of the first variable from the memory unit indicated by the first storage address, it can generate a response message including the variable value of the first variable and send the response message to the upper computer. The response message can also be called an uplink message, and the format of the response message is shown in the following table:

[0109] Table 2

[0110]

[0111] As shown in Table 2, the data of the first byte in the response message may be the relevant information that needs to be transmitted during the reading and writing process, the data of the second byte may be the data type of the first variable, the data of the third to Hth bytes may be the variable value of the first variable read, or the data of the third to Hth bytes may be a write success flag or a write failure flag obtained after the variable value of the first variable is written, where the write success flag is, for example, "1", the write failure flag is, for example, "0", and H is an integer greater than 3.

[0112] like Figure 3 As shown, when a read operation is performed on the first variable, the read and write result is the variable value of the read first variable. After receiving the response message sent by the lower computer, the upper computer 12 can parse the response message, obtain the variable value of the first variable from the response message, and display the variable value of the first variable in the second control 32.

[0113] When the first variable is written, the read / write result may be a write success flag or a write failure flag. After the lower computer successfully writes the variable value of the first variable into the memory unit corresponding to the first storage address, it may generate a response message including a write success flag, and send the response message to the upper computer 12, and the upper computer 12 may display the write success flag in the fifth control 35.

[0114] Similarly, after the writing of the first variable fails, the lower computer may generate a response message including a write failure flag, and send the response message to the upper computer 12 , and the upper computer 12 may display the write failure flag in the fifth control 35 .

[0115] It is understandable that the formats of the read / write messages and the response messages and the specific data included therein can be set as required, and may include but are not limited to the above examples.

[0116] In an embodiment of the present application, after the upper computer reads and writes the variables in the application installed in the lower computer, it receives and displays the read and write results sent by the lower computer, so that the user can know the read and write results in time and judge whether there is any abnormality in the read and write process based on the read and write results.

[0117] In some embodiments, the lower computer may be a control device composed of multiple plug-ins, which may also be called a board or an embedded system, and the control device may also be called a control system. The plug-in may include a processor for executing control tasks; a memory for storing program code, operating data, and configuration information, which may include a memory; a bus interface for communicating between different components, and various input / output devices, such as a keyboard, a sensor, an actuator, etc., but not limited thereto.

[0118] Taking the energy storage valve in the field of power energy storage technology as an example, the energy storage valve includes at least one battery cabinet for storing electric energy, the battery cabinet includes multiple battery boxes, and each battery box includes multiple battery cells connected in series and / or in parallel. The energy storage valve also includes multiple functional modules such as a voltage source converter (VSC) for commutation, a cooling system for cooling the battery cabinet, and a gas protection system for isolating the battery cabinet.

[0119] In the energy storage valve, a corresponding plug-in needs to be set for each functional module, and multiple plug-ins communicate and connect to form a control device of the energy storage valve. During the operation of the energy storage valve, each plug-in controls the operation of the corresponding functional module, so that multiple functional modules can cooperate with each other, thereby enabling the energy storage valve to operate stably.

[0120] When the lower computer is composed of multiple plug-ins, one of the plug-ins is connected to the upper computer for communication, and the plug-in can be called a master plug-in or a management plug-in, and the other plug-ins are connected to the master plug-in for communication, and can be called slave plug-ins.

[0121] Figure 4 FIG. 1 is a schematic diagram showing the composition of a control device provided in an embodiment of the present application. Figure 4 As shown, the lower computer 13 includes a main plug-in 131, a first slave plug-in 132, a second slave plug-in 133 and a third slave plug-in 134. The main plug-in 131 is communicatively connected to the upper computer 12, and the first slave plug-in 132, the second slave plug-in 133 and the third slave plug-in 134 are connected to the main plug-in 131 via a communication bus 135.

[0122] Among them, each plug-in of the lower computer 13 is provided with an application and a communication module, the application is used to execute the control task of the plug-in, and the communication module is used to communicate with other plug-ins. The master plug-in and the slave plug-in are provided with a read-write module, and the read-write module is used to read and write variables in the application installed in the plug-in. The master plug-in is also provided with a debugging module, and the debugging module is used to communicate with the upper computer 12 during the variable reading and writing process.

[0123] Figure 5 A flow chart of a variable reading and writing process provided by an embodiment of the present application is shown. Figure 5 As shown, the variable reading and writing process includes steps 51 to 61.

[0124] Step 51: The host computer generates an address mapping file.

[0125] In some embodiments, before reading and writing variables in the lower computer 13, the upper computer 12 may obtain the source program of the application installed in the lower computer 13, compile the source program, and generate an address mapping file according to the storage address allocated to each variable during the compilation process.

[0126] For example, in Figure 4 Before reading and writing the variables in the lower computer 13 shown, the upper computer 12 can obtain the source program of the application installed in the main plug-in 131, and obtain the source program of each application installed in the slave plug-in.

[0127] For the source program of the application installed in the main plug-in 131, the host computer 12 can compile the source program to obtain an executable file. During the compilation process, the host computer 12 will assign a storage address to each variable in the application, and the storage address of each variable corresponds to a memory unit in the main plug-in 131 for storing the variable. The host computer 12 can obtain the variable name of each variable from the source program of the application, and obtain the storage address assigned to each variable during the compilation process, and generate an address mapping file of the application installed in the main plug-in 131 according to the variable name and the corresponding storage address, and the address mapping file includes the variable name of each variable in the application installed in the main plug-in 131, and the storage address of each variable in the main plug-in 131.

[0128] Similarly, the host computer 12 can compile the source programs of the application programs installed in the first slave plug-in 132, the second slave plug-in 133, and the third slave plug-in 134, respectively, and generate an address mapping file of the application program installed in each slave plug-in.

[0129] After compiling the application, the host computer 12 may send the compiled executable file to the slave computer 13, and the slave computer 13 may install and run the executable file. Then, the host computer 12 may read and write the variables included in the application running in the slave computer 13.

[0130] It should be understood that when there is only one plug-in in the lower computer 13 (the plug-in is the main plug-in), the upper computer 12 can compile the source program of the application installed in the plug-in and generate an address mapping file of the application installed in the plug-in.

[0131] In other embodiments, the host computer 12 may also obtain the address mapping file of the application installed in each plug-in in the slave computer 13 in other ways. For example, when the user installs the application in the main plug-in 131, the source program of the application may be compiled by other computing devices, and an address mapping file may be generated according to the variable name and the storage address of each variable during the compilation process, and then the address mapping file may be sent to the host computer 12.

[0132] For another example, before reading and writing variables, the host computer 12 can send a file acquisition request to the main plug-in 131. After receiving the file acquisition request, the main plug-in 131 can obtain the variable name of each variable included in the application installed in the main plug-in 131, and obtain the storage address of each variable, generate an address mapping file of the application installed in the main plug-in 131 according to the obtained variable name and storage address, and then send the address mapping file to the host computer 12.

[0133] At the same time, the master plug-in 131 can send a file acquisition request to each slave plug-in respectively, and the slave plug-in can generate a corresponding address mapping file and send it to the master plug-in 131, and the master plug-in 131 sends the address mapping file to the host computer 12.

[0134] The above are merely illustrative examples, and the method for the host computer to obtain the address mapping file may include but is not limited to the above examples.

[0135] In the embodiment of the present application, the host computer obtains the address mapping file of the application by compiling the source program of the application, and can accurately and completely obtain the variables included in the application and the storage address of each variable.

[0136] Step 52: The host computer displays a variable list.

[0137] In some embodiments, when displaying the variable list, the host computer 12 may indicate that the displayed multiple variables are stored in the first plug-in by displaying the plug-in identifier of the first plug-in.

[0138] Figure 6FIG. 2 shows another interface schematic diagram of a variable reading and writing process provided by an embodiment of the present application. Figure 6 As shown, in the process of displaying multiple variables included in the application installed in the main plug-in 131, the upper computer 12 can display the operation interface 121 and the identification interface 122, and the variable list 30 is displayed in the operation interface 121, and the variable list 30 includes the variable names of multiple variables included in the application installed in the main plug-in 131.

[0139] At the same time, the plug-in identification “01” of the main plug-in 131 is displayed in the identification interface 122 , and the plug-in identification “01” may indicate that the variables included in the variable list 30 are stored in the main plug-in 131 .

[0140] Likewise, for each variable, a corresponding set of controls may be displayed in the operation interface 121. The user may determine a first variable from a plurality of variables in the variable list 30, and input a selection instruction to control the host computer 12 to read and write the first variable.

[0141] In some embodiments, when the lower computer 13 includes multiple plug-ins, the user can modify the plug-in identification displayed in the identification interface 122. When the plug-in identification is the plug-in identification of the main plug-in 131, the variable list 30 displays the variable names of the variables included in the application installed in the main plug-in 131. When the plug-in identification is the plug-in identification of a slave plug-in, the variable list 30 displays the variable names of the variables included in the application installed by the slave plug-in.

[0142] In other embodiments, when displaying the operation interface 121 and identification interface 122 of the master plug-in 131 , the host computer 12 may simultaneously display the operation interfaces and identification interfaces of the first slave plug-in 132 , the second slave plug-in 133 , and the third slave plug-in 134 .

[0143] When the operation interfaces and identification interfaces of multiple plug-ins are displayed at the same time, the plug-in identification of the main plug-in 131 is displayed in the identification interface of the main plug-in 131, and the variables in the application installed in the main plug-in 131 are displayed in the operation interface; the plug-in identification of the first slave plug-in 132 is displayed in the identification interface of the first slave plug-in 132, and the variables in the application installed in the first slave plug-in 132 are displayed in the operation interface of the first slave plug-in 132.

[0144] Similarly, the corresponding plug-in identification and variables are displayed in the identification interface and operation interface of the second slave plug-in 133 and the third slave plug-in 134 respectively.

[0145] In an embodiment of the present application, when the lower computer includes multiple plug-ins, the upper computer displays the plug-in identifier of the plug-in when displaying the variables stored in the plug-in. The plug-in identifier can indicate the plug-in in which the variable is located, which can facilitate the user to select variables in different plug-ins for reading and writing.

[0146] Step 53: The host computer determines the first variable and the first plug-in.

[0147] Step 54: The host computer sends a read / write message to the main plug-in.

[0148] In some embodiments, the upper computer can simultaneously determine the first plug-in where the first variable is located during the process of determining the first variable to be read or written, and generate a read / write message including the plug-in identifier of the first plug-in and the first storage address. Then, the upper computer can send the read / write message including the first storage address and the plug-in identifier of the first plug-in to the lower computer, so that the lower computer can read and write the first variable according to the first storage address through the first plug-in.

[0149] like Figure 6 As shown, when the user clicks the first control 31, the host computer 12 can determine that the variable corresponding to the variable name "variable 1" is the first variable in response to the user's click operation. At the same time, the host computer 12 can determine that the first variable is stored in the main plug-in 131 corresponding to the plug-in identifier "01" according to the plug-in identifier displayed in the identification interface 122, and the main plug-in 131 is the first plug-in.

[0150] At this time, the host computer 12 can determine the first storage address of the first variable from the address mapping file of the main plug-in 131 according to the variable name "variable 1", and then the host computer 12 can generate a read message and send the read message to the main plug-in 131. The read message includes the plug-in identifier and the first storage address of the main plug-in 131. As shown in Table 1, when the read message includes the plug-in identifier, the plug-in identifier can be located at the first byte in the read message.

[0151] Similarly, when the user first enters the variable value in the fourth control 34 and then clicks the third control 33, the upper computer 12 can respond to the user's click operation and determine that the variable corresponding to the variable name "variable 1" is the first variable. At the same time, the upper computer 12 can determine that the first variable is stored in the main plug-in 131 corresponding to the plug-in identifier "01".

[0152] At this time, the host computer 12 can determine the first storage address of the first variable from the address mapping file of the main plug-in 131 according to the variable name "variable 1", and then the host computer 12 can generate a write message and send the write message to the main plug-in 131. The data of the first byte in the write message is the plug-in identifier of the main plug-in 131, and the operator in the second byte is the write operator.

[0153] It is understandable that when the plug-in identifier in the identification interface is the plug-in identifier of a slave plug-in in the lower computer 13, the slave plug-in is the first plug-in, and the plug-in identifier included in the read-write message generated by the upper computer 12 is the plug-in identifier of the slave plug-in.

[0154] Step 55: The master plug-in determines whether the first plug-in is the master plug-in.

[0155] In some embodiments, after receiving the read / write message, the master plug-in 131 first parses and obtains the plug-in identifier in the read / write message, and then determines whether the first plug-in is the master plug-in according to the plug-in identifier in the read / write message. When the plug-in identifier is the plug-in identifier of the slave plug-in, the first plug-in is determined to be the slave plug-in, and the master plug-in 131 executes step 56. On the contrary, when the plug-in identifier is the plug-in identifier of the master plug-in 131, the first plug-in is determined to be the master plug-in 131, and the master plug-in 131 can execute step 59.

[0156] Step 56: The master plug-in sends a read-write message to the slave plug-in corresponding to the plug-in identifier.

[0157] Step 57: Read and write the first variable from the plug-in and obtain the reading and writing results.

[0158] Step 58: The slave plug-in sends the read and write results to the master plug-in.

[0159] Exemplarily, when the plug-in identifier is the plug-in identifier of the first slave plug-in 132, the master plug-in 131 may forward the read-write message to the first slave plug-in 132. After receiving the read-write message, the first slave plug-in 132 may parse the read-write message, obtain the first storage address and the operator from the read-write message, and then read and write the first variable according to the operator and the first storage address, and obtain the read-write result.

[0160] After obtaining the read / write result, the first slave plug-in 132 may generate a response message including the read / write result, and send the response message to the master plug-in 131. The response message may include a plug-in identifier of the first slave plug-in 132 to identify that the read / write message is generated and sent by the first slave plug-in 132. As shown in Table 2, when the response message includes a plug-in identifier, the plug-in identifier may be located in the first byte of the response message.

[0161] Step 59: The main plug-in reads and writes the first variable and obtains the reading and writing results.

[0162] Step 60: The main plug-in sends the read and write results to the host computer.

[0163] In this embodiment, when it is determined that the plug-in identifier in the read-write message is the plug-in identifier of the main plug-in 131, the main plug-in 131 can directly read and write the first variable according to the first storage address in the read-write message and obtain the read-write result, and then the main plug-in 131 can generate a response message including the read-write result, and send the response message to the host computer 12. The plug-in identifier of the main plug-in 131 can be included in the read-write message to identify that the response message is generated and sent by the main plug-in 131.

[0164] After receiving the response message sent by the slave plug-in, the master plug-in 131 can forward the response message to the host computer 12.

[0165] like Figure 4 As shown, step 55, step 56 and step 60 can be executed by the debugging module in the master plug-in, step 59 can be executed by the read-write module in the master plug-in, and step 57 and step 58 can be executed by the read-write module in the slave plug-in.

[0166] Step 61: The host computer displays the reading and writing results.

[0167] In this embodiment, after receiving the response message, the upper computer 13 can first parse and obtain the plug-in identifier included in the response message. When the plug-in identifier is the plug-in identifier of the main plug-in 131, the read and write results in the read and write message can be displayed in the operation interface corresponding to the main plug-in 131. When the plug-in identifier is the plug-in identifier of the first slave plug-in 132, the read and write results in the read and write message can be displayed in the operation interface corresponding to the first slave plug-in 132.

[0168] In an embodiment of the present application, the upper computer sends a read-write message including a storage address and a plug-in identifier to the lower computer, so that the lower computer can determine the plug-in in which the variable is located according to the plug-in identifier, and read and write the variable through the corresponding plug-in. The variables in any plug-in included in the lower computer can be read and written to meet the user's needs for reading and writing variables in different plug-ins.

[0169] It can be understood that the variable reading and writing method provided in this embodiment can be applied not only in variable debugging scenarios, but also in application monitoring scenarios and other scenarios that require variable reading and writing.

[0170] Figure 7 FIG. 1 shows a schematic diagram of the structure of a variable reading and writing device provided in an embodiment of the present application. Figure 7 As shown, the variable reading and writing device 7 includes a determination module 71 , an acquisition module 72 , a sending module 73 , a compilation module 74 and a display module 75 .

[0171] A determination module 71, for determining a first variable to be read or written from a plurality of variables of an application program, the application program being installed on a lower computer;

[0172] An acquisition module 72, used for acquiring a first storage address of a first variable in a lower computer;

[0173] The sending module 73 is used to send a read / write message including a first storage address to the lower computer, and the read / write message is used to enable the lower computer to read and write the first variable according to the first storage address.

[0174] In some embodiments, the application is installed in a first plug-in among multiple plug-ins included in the lower computer, and the read / write message includes a plug-in identifier of the first plug-in, which is used to enable the lower computer to read and write the first variable through the first plug-in.

[0175] In some embodiments, the acquisition module 72 is specifically used to acquire the first storage address from an address mapping file, where the address mapping file includes a plurality of variables and a storage address of each variable in the lower computer.

[0176] In some embodiments, the compiling module 74 is used to compile the source program of the application program and generate an address mapping file according to the storage addresses allocated to multiple variables during the compiling process.

[0177] In some embodiments, the determination module 71 is specifically used to display multiple variables; in response to an input selection instruction, determine a first variable from the multiple variables.

[0178] In some embodiments, the display module 75 is configured to indicate that the displayed multiple variables are stored in the first plug-in by displaying a plug-in identifier of the first plug-in.

[0179] In some embodiments, the display module 75 is used to receive the read-write result sent by the lower computer after reading and writing the first variable according to the read-write message; and display the read-write result.

[0180] Figure 8 FIG. 1 shows a schematic diagram of the structure of a variable reading and writing device provided in an embodiment of the present application. Figure 8 As shown, the variable reading and writing device 8 is arranged in the lower computer, and may include a receiving module 81 , a reading and writing module 82 and a sending module 83 .

[0181] A receiving module 81, configured to receive a read / write message sent by a host computer, wherein the read / write message includes a first storage address of a first variable in a slave computer, and the first variable is one of a plurality of variables included in an application program of the slave computer;

[0182] The read / write module 82 is used to read and write the first variable according to the first storage address.

[0183] In some embodiments, the read / write message includes a plug-in identifier, and the read / write module 82 is specifically used to determine a first plug-in corresponding to the plug-in identifier from multiple plug-ins included in the lower computer; and read / write the first variable through the first plug-in.

[0184] In some embodiments, the sending module 83 is used to send the reading and writing results obtained after reading and writing the first variable to the host computer.

[0185] Fig. 9 FIG. 1 shows a structural block diagram of a variable reading and writing device provided in an embodiment of the present application. Fig. 9As shown, the variable reading and writing device 9 includes a processor 91 and a memory 92 , and the above-mentioned components can be connected via one or more buses 94 .

[0186] The variable reading and writing device 9 also includes a computer program 93, which is stored in the memory 92. When the computer program 93 is executed by the processor 91, the variable reading and writing device 9 performs the above Figure 2 and Figure 5 The variable reading and writing methods are shown.

[0187] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding physical device, and will not be repeated here.

[0188] An embodiment of the present application also provides a readable storage medium, which includes a computer program. When the computer program is executed on a computer, the computer executes the method provided by the above method embodiment.

[0189] An embodiment of the present application also provides a computer program product comprising instructions, and when the computer program product is run on a computer, the computer is enabled to execute the method provided by the above method embodiment.

[0190] An embodiment of the present application also provides a chip system, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a variable reading and writing device equipped with the chip system executes the method provided in the above method embodiment.

[0191] Among them, the chip system may include an input circuit or interface for sending information or data, and an output circuit or interface for receiving information or data.

[0192] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0193] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0194] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0195] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0196] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0197] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0198] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0199] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0200] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for reading and writing variables, It is characterized in that The method comprises: Determining a first variable to be read or written from a plurality of variables of an application program installed on a lower computer; Obtaining a first storage address of the first variable in the lower computer; A read / write message including the first storage address is sent to the lower computer, wherein the read / write message is used to enable the lower computer to read and write the first variable according to the first storage address.

2. The method according to claim 1, It is characterized in that The application is installed in a first plug-in among multiple plug-ins included in the lower computer, and the read-write message includes a plug-in identifier of the first plug-in, and the plug-in identifier is used to enable the lower computer to read and write the first variable through the first plug-in.

3. The method according to claim 1, It is characterized in that The obtaining of the first storage address of the first variable in the lower computer includes: The first storage address is obtained from an address mapping file, wherein the address mapping file includes the multiple variables and the storage address of each variable in the lower computer.

4. The method according to claim 3, It is characterized in that Before acquiring the first storage address from the address mapping file, the method further includes: The source program of the application is compiled, and the address mapping file is generated according to the storage addresses allocated to the multiple variables during the compilation process.

5. The method according to claim 1, It is characterized in that The step of determining a first variable to be read or written from a plurality of variables of the application program includes: displaying the plurality of variables; In response to the input selection instruction, the first variable is determined from the plurality of variables.

6. The method according to claim 5, It is characterized in that The application is installed in a first plug-in among a plurality of plug-ins included in the lower computer, and the method further comprises: The plurality of variables displayed by displaying the plug-in identification indication of the first plug-in are stored in the first plug-in.

7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: receiving a read / write result sent by the lower computer after reading and writing the first variable according to the read / write message; The reading and writing results are displayed.

8. A method for reading and writing variables, It is characterized in that Applied to a lower computer, the method includes: Receiving a read / write message sent by a host computer, wherein the read / write message includes a first storage address of a first variable in the slave computer, and the first variable is one of a plurality of variables included in an application program of the slave computer; The first variable is read and written according to the first storage address.

9. The method according to claim 8, It is characterized in that The read / write message includes a plug-in identifier, and the reading and writing of the first variable according to the first storage address includes: Determine a first plug-in corresponding to the plug-in identifier from a plurality of plug-ins included in the lower computer; The first variable is read and written through the first plug-in.

10. The method according to claim 8 or 9, It is characterized in that The method further comprises: The read and write results obtained after reading and writing the first variable are sent to the host computer.

11. A variable reading and writing device, It is characterized in that The device comprises: A determination module, used for determining a first variable to be read or written from a plurality of variables of an application program, wherein the application program is installed on a lower computer; An acquisition module, used for acquiring a first storage address of the first variable in the lower computer; A sending module is used to send a read-write message including the first storage address to the lower computer, and the read-write message is used to enable the lower computer to read and write the first variable according to the first storage address.

12. The device according to claim 11, It is characterized in that The application is installed in a first plug-in among multiple plug-ins included in the lower computer, and the read-write message includes a plug-in identifier of the first plug-in, and the plug-in identifier is used to enable the lower computer to read and write the first variable through the first plug-in.

13. The device according to claim 11, It is characterized in that The acquisition module is specifically used to acquire the first storage address from an address mapping file, wherein the address mapping file includes the multiple variables and the storage address of each variable in the lower computer.

14. The device according to claim 13, It is characterized in that The device also includes: The compiling module is used to compile the source program of the application program and generate the address mapping file according to the storage addresses allocated to the multiple variables during the compiling process.

15. The device according to claim 11, It is characterized in that The determination module is specifically configured to display the plurality of variables; and determine the first variable from the plurality of variables in response to an input selection instruction.

16. The device according to claim 15, It is characterized in that The application is installed in a first plug-in among a plurality of plug-ins included in the lower computer, and the device further includes: The display module is configured to indicate that the plurality of variables displayed by displaying a plug-in identification of the first plug-in are stored in the first plug-in.

17. The device according to any one of claims 11 to 16, It is characterized in that The device also includes: The display module is used to receive the read-write result sent by the lower computer after reading and writing the first variable according to the read-write message; and display the read-write result.

18. A variable reading and writing device, It is characterized in that Set in the lower computer, the device includes: A receiving module, used for receiving a read-write message sent by a host computer, wherein the read-write message includes a first storage address of a first variable in the slave computer, and the first variable is one of a plurality of variables included in an application program of the slave computer; A read / write module is used to read and write the first variable according to the first storage address.

19. The device according to claim 18, It is characterized in that The read / write message includes a plug-in identifier, and the read / write module is specifically used to determine a first plug-in corresponding to the plug-in identifier from a plurality of plug-ins included in the lower computer; and read and write the first variable through the first plug-in.

20. The device according to claim 18 or 19, It is characterized in that The device also includes: The sending module is used to send the reading and writing results obtained after reading and writing the first variable to the host computer.

21. A readable storage medium, It is characterized in that The readable storage medium stores a computer program, and when the computer program runs on the variable reading and writing device, the variable reading and writing device executes the method according to any one of claims 1 to 10.