Configuration method of upper computer and electronic device
By establishing a connection with the lower computer and modifying the register configuration of the upper computer according to its needs, the problem of limited universality and compatibility of the upper computer equipment is solved, and flexible adaptation to different types of lower computer equipment and reducing system deployment costs are achieved.
Patent Information
- Application Number
- CN202411606579.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Due to the one-to-one hardware matching mode, existing computer equipment has limited system universality and compatibility, making it difficult to adapt to rapidly changing market demands and diversified equipment environments, which increases the complexity and cost of system deployment.
By establishing a connection with the lower computer, obtain its register requirements, and modify the register configuration of the upper computer according to the requirements, including the number of registers and configuration parameters, such as address, length, data type, etc., to meet the needs of different types of lower computer equipment.
It improves the universality and compatibility of the upper computer, allowing it to flexibly adapt to the needs of different types of lower computer equipment, and reduces the complexity and cost of system deployment.
Smart Images

Figure CN119149135A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of numerical control equipment, and in particular to a configuration method and an electronic device of a host computer. Background Art
[0002] The host computer is a computer that can issue specific control commands and can control the lower-level devices to complete various operations through pre-set commands. Usually, the host computer generally adopts a one-to-one hardware matching mode, that is, one host computer matches one lower-level device. However, this matching mode limits the versatility and compatibility of the system, which not only increases the complexity and cost of system deployment, but also limits the flexible interconnection and interoperability between devices, making it difficult to adapt to the rapidly changing market demands and diverse equipment environments. Summary of the invention
[0003] The embodiments of the present application provide a configuration method of a host computer and an electronic device.
[0004] In a first aspect, an embodiment of the present application provides a configuration method of a host computer, the method comprising: Establish a connection with the lower computer; Get the register requirements of the lower computer; Modify the register configuration of the host computer according to the register requirements.
[0005] Optionally, the configuration of the register includes the number of registers and configuration parameters of the registers, and the configuration parameters of the registers are used to specify the performance of the registers.
[0006] Optionally, the configuration parameters of the register include one or more of the following: Register address, used to indicate the address of the register in the host computer; Length, used to indicate the number of bytes that the register can store; Parameters, used to indicate the parameters stored in the register; Data type, used to indicate the type of data that the register can store; The magnification is used to indicate the magnification of the register when storing data; Unit, used to indicate the unit of the parameter stored in the register; Remarks: used to indicate the remark information of the parameters stored in the register; Maximum value, used to indicate the maximum value of the parameter stored in the register; Minimum value, used to indicate the minimum value of the parameter stored in the register.
[0007] Optionally, modify the configuration of the registers of the host computer according to the register requirements, including: Generate modification information based on register requirements; The modification information is mapped to a first table of the host computer, where the first table is used to store register configuration information of the host computer.
[0008] In a second aspect, an embodiment of the present application provides a host computer, including: A connection module is used to establish a connection with a lower computer; The acquisition module is used to obtain the register requirements of the lower computer; The modification module is used to modify the configuration of the registers of the host computer according to the register requirements.
[0009] Optionally, the configuration of the register includes the number of registers and configuration parameters of the registers, and the configuration parameters of the registers are used to specify the performance of the registers.
[0010] Optionally, the configuration parameters of the register include one or more of the following: Register address, used to indicate the address of the register in the host computer; Length, used to indicate the number of bytes that the register can store; Parameters, used to indicate the parameters stored in the register; Data type, used to indicate the type of data that the register can store; The magnification is used to indicate the magnification of the register when storing data; Unit, used to indicate the unit of the parameter stored in the register; Remarks: used to indicate the remark information of the parameters stored in the register; Maximum value, used to indicate the maximum value of the parameter stored in the register; Minimum value, used to indicate the minimum value of the parameter stored in the register.
[0011] Optionally, modify the module to: Generate modification information based on register requirements; The modification information is mapped to a first table of the host computer, where the first table is used to store register configuration information of the host computer.
[0012] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, at least one processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a method as described in any one of the above-mentioned first aspects is implemented.
[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the above-mentioned first aspects is implemented.
[0014] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods described in the first aspect.
[0015] Based on this application, the register configuration of the upper computer can be modified according to the needs of the lower computer, so that the upper computer can adapt to the needs of different types of lower computer devices, which helps to improve the versatility and compatibility of the upper computer. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for describing the embodiments are briefly introduced below.
[0017] Figure 1 It is a flowchart of the configuration method of the host computer provided in the embodiment of the present application.
[0018] Figure 2 This is an example diagram of a configuration method of a host computer provided in an embodiment of the present application.
[0019] Figure 3 This is an example diagram of a configuration method of a host computer provided in another embodiment of the present application.
[0020] Figure 4 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0021] Figure 5 It is a structural schematic diagram of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0022] The technical solution of the embodiment of the present invention will be described below in conjunction with the accompanying drawings in the embodiment of the present invention.
[0023] The host computer is a computer that can issue specific control commands. It can control the lower computer equipment to complete various operations through pre-set commands. The host computer can communicate with the lower computer through various communication protocols (such as recommended standard (RS) 232, RS485, Ethernet, etc.) to obtain the operating status of the lower computer, send control commands, etc. At present, the host computer is widely used in automation control systems.
[0024] Usually, the host computer generally adopts a one-to-one hardware matching mode, that is, one host computer matches one slave device. However, the types of slave devices are increasing, and each device has a unique communication protocol and data format, etc., so this matching mode limits the versatility and compatibility of the system. This not only increases the complexity and cost of system deployment, but also limits the flexible interconnection and interoperability between devices, making it difficult to adapt to rapidly changing market demands and diverse device environments.
[0025] Based on this, Figure 1 The embodiment of the present application provides a configuration method for a host computer. The method is applicable to the host computer, and the type of the host computer is not limited.
[0026] See also Figure 1 , the method may include steps S110-S130.
[0027] In step S110, a connection is established with a lower computer. The lower computer can be any type of lower computer, and this application does not limit it. The upper computer can establish a connection with the lower computer through a corresponding communication protocol, such as RS232, RS485, Ethernet and other protocols.
[0028] In step S120, the register requirement of the lower computer is obtained. The upper computer may obtain the register requirement of the lower computer by sending instructions to the lower computer. The register requirement of the lower computer may include configuration parameters and number of registers required by the lower computer.
[0029] In step S130, the configuration of the register of the host computer is modified according to the register requirement. For example, the content in the register configuration file of the host computer can be modified according to the register requirement so that the host computer can read the register configuration information required by the lower computer. When the host computer reads the modified register configuration information, the register can be configured according to the requirements of the lower computer.
[0030] Based on this application, the register configuration of the upper computer can be modified according to the needs of the lower computer, so that the upper computer can adapt to the needs of different types of lower computer devices, which helps to improve the versatility and compatibility of the upper computer.
[0031] Optionally, the configuration of the register may include the number of registers and configuration parameters of the registers, and the configuration parameters of the registers may be used to specify the performance of the registers. Based on the number of registers and the configuration parameters of the registers, the registers of the host computer may be adapted to the data format and storage requirements of the slave computer.
[0032] Furthermore, the configuration parameters of the register may include one or more of the following: register address; length; parameter; data type; multiplier; unit; remark; maximum value; minimum value.
[0033] The register address can be used to indicate the address of the register in the host computer; the length can be used to indicate the number of bytes that the register can store, such as 2 bytes; the parameter can be used to indicate the parameter stored in the register, such as voltage or current; the data type can be used to indicate the data type that the register can store, such as integer or floating point; the multiplier can be used to indicate the multiplier when the register stores data; the unit can be used to indicate the unit of the parameter stored in the register, such as the unit V of voltage or the unit A of current; the remark can be used to indicate the remark information of the parameter stored in the register; the maximum value can be used to indicate the maximum value of the parameter stored in the register, such as the maximum value of voltage; the minimum value can be used to indicate the minimum value of the parameter stored in the register, such as the minimum value of voltage. It is worth noting that the configuration parameters of the register can also include other content, which can be determined according to actual needs.
[0034] Optionally, step S130 may include step S131 and step S132.
[0035] In step S131, modification information is generated based on the register requirement.
[0036] In step S132, the modification information is mapped to a first table of the host computer, and the first table can be used to store register configuration information of the host computer.
[0037] Exemplarily, the first table can be an Excel file in a debug folder under an executable binary (bin) file of the host computer, and the format of the modified information can be set according to the data format in the Excel file. When the host computer reads the register configuration information in the Excel file, the modified register configuration information can be obtained. Based on the first table, it helps the host computer to quickly read the register configuration required by the lower computer.
[0038] Combine the following Figure 2 and Figure 3 , an example is given to introduce the configuration method of the host computer in the embodiment of the present application.
[0039] like Figure 2 As shown, usually when the host computer starts, it will first check whether the serial port attribute information is normal. If the serial port is not configured or opened, the user will be reminded to configure the serial port. In addition, before executing each instruction, the host computer will also check whether the serial port is normal. If it is not normal, a pop-up box will be displayed to remind you.
[0040] Exemplarily, after the host computer is started, the entire host computer homepage may include a data display module, a fault code module, a debugging curve module and an editing register module. Among them, the data display module can be used to display the data in the register, including measured data, debugging data and calibration data. The measured data is generated during actual use, such as measured data 1 and measured data 2. The debugging data is generated during the debugging process, such as debugging data 1 and debugging data 2. The calibration data is the data obtained by calibration, such as calibration data 1 and calibration data 2. The fault code module can be used to display the fault information of the host computer in real time. The debugging curve module can be used to update and record the debugging curve. The updating process of the debugging curve may include: the host computer uses a sending thread to send instructions to the lower computer to obtain data, and uses a receiving thread to receive data, and then updates the debugging curve according to the received data. The editing register module can be used to display the information of the register and modify the register information of the host computer according to the needs of the lower computer. The register information may include the measured data, debugging data and calibration data of the register. In addition, the host computer also has a data log (log) function for recording data during the interaction between the host computer and the lower computer. For example, the data generated by the debugging curve module during the process of updating the debugging curve can be stored in the data log.
[0041] For example, the process of modifying the register information of the host computer can be as follows: Figure 3 As shown. After the upper computer is connected to the lower computer, the user can enter the upper computer homepage and configure the serial port first. After the serial port configuration is successful, the user jumps to the edit register interface through the [Edit Register] function in the [Settings] function. The edit register page can read the excel file in the debug folder under the executable bin file of the upper computer to obtain the current register information and display it on the page. After the user enters the edit register page, if the user chooses to modify the register information, the user's customized modification information (number of registers, register parameters) based on the needs of the lower computer is collected. Convert the modification information into binary form and write it into the mapped excel file, and the register information on the page can be updated. When the upper computer reads the register information from the excel file, it obtains the modified register information.
[0042] based on Figure 3 The method shown can fully customize the register information of the upper computer according to the needs of the lower computer, thereby adapting to different types of lower computers and achieving the versatility of the upper computer.
[0043] The method provided in the embodiment of the present application is described in detail above. The device provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0044] See also Figure 4, is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 The electronic device 400 shown may include a connection module 410 , an acquisition module 420 , and a modification module 430 .
[0045] The connection module 410 can be used to establish a connection with a lower computer; The acquisition module 420 may be used to acquire the register requirements of the lower computer; The modification module 430 may be used to modify the configuration of the registers of the host computer according to the register requirements.
[0046] Optionally, the configuration of the register may include the number of registers and configuration parameters of the registers, and the configuration parameters of the registers may be used to specify the performance of the registers.
[0047] Optionally, the configuration parameters of the register may include one or more of the following: Register address, which can be used to indicate the address of the register in the host computer; Length, which can be used to indicate the number of bytes that a register can store; Parameters, which can be used to indicate the parameters stored in registers; Data type, which can be used to indicate the type of data that a register can store; The magnification can be used to indicate the magnification of the register when storing data; Unit, which can be used to indicate the unit of the parameter stored in the register; Remarks, which can be used to indicate the remark information of the parameters stored in the register; Maximum value, which can be used to indicate the maximum value of the parameter stored in the register; Minimum value, which can be used to indicate the minimum value of the parameter stored in the register.
[0048] Optionally, the modification module 430 may be used to: Generate modification information based on register requirements; The modification information is mapped to a first table of the host computer, and the first table can be used to store register configuration information of the host computer.
[0049] The present application also provides an electronic device. Figure 5 As shown, the electronic device 500 includes: at least one processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the at least one processor 501. When the processor 501 executes the computer program 503, the method provided in the present application is implemented.
[0050] Exemplarily, the computer program 503 may be divided into one or more modules / units, one or more modules / units are stored in the memory 502, and are executed by the processor 501 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 500.
[0051] Those skilled in the art will understand that Figure 5 It is only an example of the electronic device 500 and does not constitute a limitation of the electronic device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 500 may also include input and output devices, network access devices, buses, etc.
[0052] The processor 501 may be a central processing unit (CPU), or 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 be any conventional processor, etc.
[0053] The memory 502 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. The memory 502 may also be an external storage device of the electronic device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 500. Further, the memory 502 may also include both an internal storage unit of the electronic device 500 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device 500. The memory 502 may also be used to temporarily store data that has been output or is to be output.
[0054] The electronic device 500 provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0055] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0056] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0057] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above method embodiments, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, ROM (read-only memory), RAM (random access memory), CD-ROM (compact disc read-only memory), magnetic tape, floppy disk and optical data storage device. The computer-readable storage medium mentioned in the present application can be a non-volatile storage medium, in other words, it can be a non-transient storage medium.
[0058] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0059] 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.
[0060] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and 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.
[0061] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of 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 combinations thereof.
[0062] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0063] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0064] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A configuration method of a host computer, It is characterized in that include: Establish a connection with the lower computer; Obtaining the register requirements of the lower computer; Modify the configuration of the register of the host computer according to the register requirement.
2. The method according to claim 1, It is characterized in that The configuration of the registers includes the number of the registers and configuration parameters of the registers, and the configuration parameters of the registers are used to specify the performance of the registers.
3. The method according to claim 2, It is characterized in that The configuration parameters of the register include one or more of the following: Register address, used to indicate the address of the register in the host computer; Length, used to indicate the number of bytes that the register can store; Parameter, used to indicate the parameter stored in the register; Data type, used to indicate the type of data that the register can store; A magnification, used to indicate the magnification of the register when storing data; Unit, used to indicate the unit of the parameter stored in the register; Remarks, used to indicate the remark information of the parameter stored in the register; A maximum value, used to indicate the maximum value of the parameter stored in the register; The minimum value is used to indicate the minimum value of the parameter stored in the register.
4. The method according to claim 3, It is characterized in that The step of modifying the configuration of the register of the host computer according to the register requirement includes: generating modification information based on the register requirement; The modification information is mapped to a first table of the host computer, where the first table is used to store register configuration information of the host computer.
5. A host computer, It is characterized in that include: A connection module is used to establish a connection with a lower computer; An acquisition module, used for acquiring the register requirements of the lower computer; A modification module is used to modify the configuration of the register of the host computer according to the register requirement.
6. The host computer according to claim 5, It is characterized in that The configuration of the registers includes the number of the registers and the configuration parameters of the registers, and the configuration parameters of the registers are used to specify the performance of the registers.
7. The host computer according to claim 6, It is characterized in that The configuration parameters of the register include one or more of the following: Register address, used to indicate the address of the register in the host computer; Length, used to indicate the number of bytes that the register can store; Parameter, used to indicate the parameter stored in the register; Data type, used to indicate the type of data that the register can store; A magnification, used to indicate the magnification of the register when storing data; Unit, used to indicate the unit of the parameter stored in the register; Remarks, used to indicate the remark information of the parameter stored in the register; A maximum value, used to indicate the maximum value of the parameter stored in the register; The minimum value is used to indicate the minimum value of the parameter stored in the register.
8. The host computer according to claim 7, It is characterized in that The modification module is used to: generating modification information based on the register requirement; The modification information is mapped to a first table of the host computer, where the first table is used to store register configuration information of the host computer.
9. An electronic device comprising a memory, at least one processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Multiplexing method of monitoring system variables
CN103942311A
Realization method of logic control of VB / VC (Microsoft Visual Basic 6.0 / Microsoft Visual C++) and PLC (Programmable Logic Controller) on the basis of serial communication
CN105353715A
Data transmission method and device for upper computer and lower computer
CN112242941A
Method and device for software simulation of communication among multiple systems
CN116401900A
Data transmission method in vehicle communication interface apparatus and vehicle communication interface apparatus
US20210134086A1
