CN113031880B - Upper computer communication method and system suitable for multi-model storage equipment - Google Patents

Upper computer communication method and system suitable for multi-model storage equipment Download PDF

Info

Publication number
CN113031880B
CN113031880B CN202110581363.9A CN202110581363A CN113031880B CN 113031880 B CN113031880 B CN 113031880B CN 202110581363 A CN202110581363 A CN 202110581363A CN 113031880 B CN113031880 B CN 113031880B
Authority
CN
China
Prior art keywords
upper computer
data
embedded storage
storage device
embedded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110581363.9A
Other languages
Chinese (zh)
Other versions
CN113031880A (en
Inventor
曾涛
刘宇洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Bojiang Information Technology Co Ltd
Original Assignee
Hunan Bojiang Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Bojiang Information Technology Co Ltd filed Critical Hunan Bojiang Information Technology Co Ltd
Priority to CN202110581363.9A priority Critical patent/CN113031880B/en
Publication of CN113031880A publication Critical patent/CN113031880A/en
Application granted granted Critical
Publication of CN113031880B publication Critical patent/CN113031880B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an upper computer communication method and system suitable for multi-model storage equipment, wherein the method comprises the following steps: after the upper computer is communicated with the embedded storage equipment, the upper computer acquires a metadata description file in the embedded storage equipment, wherein the metadata description file comprises parameter names, and storage addresses and data lengths which respectively correspond to the parameter names; the upper computer generates a corresponding hash table based on the metadata description file, wherein keys of the hash table are variable names, and values of the hash table are the storage addresses corresponding to the variable names and the data lengths corresponding to the variable names; the upper computer communication method applicable to the multi-model storage equipment provided by the invention can directly communicate with the embedded storage equipment of different models without depending on a communication protocol, reads or modifies data in the embedded storage equipment of different models, can completely abandon the communication protocol, and is simpler and more convenient to operate.

Description

Upper computer communication method and system suitable for multi-model storage equipment
Technical Field
The invention relates to the technical field of embedded storage equipment communication methods, in particular to an upper computer communication method and system suitable for multi-model storage equipment.
Background
With the advancement of informatization, embedded storage devices are applied more and more widely in the fields of industrial production and civil life; the embedded storage device can store a large amount of data in the working process, and managers usually establish communication connection with the embedded storage device through an upper computer to acquire the data or modify the data.
The existing method for communicating the upper computer and the embedded storage device is that the upper computer selects a matched communication protocol according to the model of the embedded device, then the connection is carried out based on the matched communication protocol, and the data stored in the embedded storage device is displayed or modified through a software interface of the upper computer.
However, as the models of the embedded storage devices are more and more, and the configuration parameter content and the control command of each embedded storage device are different, more and more communication protocols and software interfaces need to be developed by the upper computer to adapt to the embedded storage devices of different models, and after hardware or software of the embedded storage devices is upgraded, the communication protocols need to be updated synchronously by the upper computer and issued synchronously with the embedded storage devices, so that the whole operation flow is very complicated, and communication faults are easily caused because the upper computer and the embedded storage devices cannot be matched with the communication protocols correctly.
Disclosure of Invention
The invention mainly aims to provide a host computer communication method and system suitable for multi-model storage equipment, and aims to solve the problems that the existing host computer and embedded storage equipment communicate by matching communication protocols, the operation process is very complicated, and communication faults are easily caused because the host computer and the embedded storage equipment cannot be matched with the communication protocols correctly.
The technical scheme provided by the invention is as follows:
a communication method of an upper computer suitable for multi-model storage equipment is applied to a communication system of the upper computer suitable for the multi-model storage equipment; the upper computer communication system suitable for the multi-model storage equipment comprises an upper computer and embedded storage equipment; the embedded storage device comprises a computing module; the method comprises the following steps:
after the upper computer communicates with the embedded storage equipment, the upper computer acquires a metadata description file in the embedded storage equipment, wherein the metadata description file comprises parameter names, and storage addresses and data lengths which respectively correspond to the parameter names;
the upper computer generates a corresponding hash table based on the metadata description file, wherein keys of the hash table are variable names, values of the hash table comprise the storage addresses corresponding to the variable names and the data lengths corresponding to the variable names, and the storage addresses and the data lengths are spliced and combined to form the values of the hash table, wherein the variable names correspond to the parameter names one to one;
the upper computer reads the data in the embedded storage equipment based on the hash table, or the upper computer modifies the data in the embedded storage equipment based on the hash table;
after the upper computer communicates with the embedded storage device, the upper computer acquires a metadata description file in the embedded storage device, and the method also comprises the following steps:
the embedded storage equipment stores the MAC address received for the first time and marks the MAC address as a safe address;
the upper computer is in communication connection with the embedded storage device;
the upper computer sends the MAC address of the upper computer to the embedded storage equipment;
the computing module judges whether the MAC address of the upper computer in the current communication connection is consistent with the safe address;
if yes, allowing the upper computer to execute the step of acquiring the metadata description file in the embedded storage equipment;
if not, the step that the upper computer acquires the metadata description file in the embedded storage equipment is not allowed to be executed.
Preferably, the metadata description file further includes units and data types respectively corresponding to the parameter names; the steps that the upper computer generates a corresponding hash table based on the metadata description file and the upper computer reads the data in the embedded storage equipment based on the hash table, or the upper computer modifies the data in the embedded storage equipment based on the hash table include:
and the upper computer generates a data display interface based on the metadata description file, wherein the data display interface is used for displaying the parameter names and displaying the data values, the storage addresses, the data lengths, the units and the data types which respectively correspond to the parameter names.
Preferably, the reading, by the upper computer, data in the embedded storage device based on the hash table includes:
the upper computer acquires an input reading instruction and a corresponding reading parameter name;
the upper computer takes the read parameter name as the variable name according to the hash table based on the read instruction, so as to obtain the storage address corresponding to the read parameter name and mark the storage address as a first target address, and obtain the data length corresponding to the read parameter name and mark the data length as a first target length;
the upper computer sends the first target address and the first target length to the embedded storage device;
the embedded storage equipment reads the data with the length of the first target address as the length of the first target address, and marks the read data as first target data;
the embedded storage equipment sends the first target data to the upper computer;
the upper computer displays the first target data as the data value corresponding to the read parameter name in the display interface;
the host computer modifies the data in the embedded storage device based on the hash table, and the method comprises the following steps:
the upper computer acquires an input modification instruction, and a modification parameter name and modification data corresponding to the modification instruction;
the upper computer acquires the storage address corresponding to the modification parameter name according to the hash table based on the modification instruction, marks the storage address as a second target address, acquires the data length corresponding to the modification parameter name, and marks the data length as a second target length;
the upper computer sends the modified data, the second target address and the second target length to the embedded storage device;
and the embedded storage equipment replaces the original data with the length of the second target address in the second target address with the modified data.
Preferably, the upper computer reads the data in the embedded storage device based on the hash table, and further includes:
the upper computer acquires an input specified parameter name;
the upper computer takes the appointed parameter name as a variable name according to the Hash table so as to obtain the storage address corresponding to the appointed parameter name and mark the storage address as a third target address, and obtain the data length corresponding to the appointed parameter name and mark the data length as a third target length;
the upper computer sends the third target address and the third target length to the embedded storage device;
the embedded storage equipment acquires a first preset time period;
the embedded storage device reads the data with the length of the third target address being the third target length once every other first preset time period, and marks the read data as third target data;
the embedded storage equipment sends the third target data to the upper computer every other first preset time period;
and the upper computer displays the third target data as the data value corresponding to the specified parameter name in the display interface, and updates the third target data every other first preset time period.
Preferably, the embedded storage device further comprises a computing module; the embedded storage device acquires a first preset time period, and comprises:
the calculation module acquires the total amount of the third target data in a second time period preset in the past;
the calculation module acquires an average value of the third target data in a second time period preset in the past;
the calculation module acquires the number of differences between each third target data and the average value in the past preset second time period, wherein the number of the differences is larger than a preset difference value, and the differences are marked as mutation numbers, wherein the preset difference value is a preset percentage of the average value;
the calculation module generates the first preset time period according to a ratio of the mutation number to the total number, wherein the first preset time period is smaller when the ratio is larger, and the first preset time period is larger when the ratio is smaller.
Preferably, the embedded storage device further comprises a computing module; after the upper computer communicates with the embedded storage device, the upper computer acquires a metadata description file in the embedded storage device, and the method also comprises the following steps:
the embedded storage equipment stores the MAC address received for the first time and marks the MAC address as a safe address;
the upper computer is in communication connection with the embedded storage device;
the upper computer sends the MAC address of the upper computer to the embedded storage equipment;
the computing module judges whether the MAC address of the upper computer in the current communication connection is consistent with the safe address;
if yes, allowing the upper computer to execute the step of acquiring the metadata description file in the embedded storage equipment;
if not, the step that the upper computer acquires the metadata description file in the embedded storage equipment is not allowed to be executed.
Preferably, the embedded storage device further comprises a computing module; the upper computer communication method suitable for the multi-model storage equipment further comprises the following steps:
the calculation module obtains the total number of the parameter names in the metadata description file
Figure 369529DEST_PATH_IMAGE001
The computing module obtains the total times of modifying the data in the embedded storage device in the third preset time period in the past
Figure 585746DEST_PATH_IMAGE002
The calculation module calculates the data risk coefficient at the current moment
Figure 68853DEST_PATH_IMAGE003
Figure 952495DEST_PATH_IMAGE004
Wherein the content of the first and second substances,
Figure 426202DEST_PATH_IMAGE003
in order to be said risk factor,
Figure 146027DEST_PATH_IMAGE005
for the times that the interval time for modifying the data in the embedded storage device in the third preset time period in the past is less than the preset time length, the value is greater than or equal to 0;
Figure 97803DEST_PATH_IMAGE006
storing the modified data into the same second target address within the third preset time period in the past, wherein the value is greater than or equal to 0;
Figure 101531DEST_PATH_IMAGE007
taking the value of the second target address of which the modified data is stored in the third preset time period in the past to be greater than or equal to 0;
and when the data danger coefficient is larger than a critical value, the embedded storage equipment is disconnected from the communication connection with the upper computer.
Preferably, the upper computer communication system suitable for the multi-model storage devices includes a plurality of storage subgroups, each storage subgroup has a unique group code, each storage subgroup has one or more embedded storage devices therein, and each embedded storage device in each storage subgroup has the same metadata storage rule, where the same metadata storage rule includes: the storage addresses corresponding to the same parameter name are the same and the corresponding data lengths are the same; the method further comprises the following steps:
acquiring a group code of the embedded storage equipment which establishes communication with the upper computer, and acquiring a metadata description file of the embedded storage equipment which establishes communication with the upper computer;
and generating the metadata description file and the corresponding hash table of each embedded storage device in the same group code in the upper computer according to the metadata description file of the embedded storage device and the group code which are communicated with the upper computer.
Preferably, the upper computer communication system suitable for the multi-model storage equipment comprises an instruction management module arranged in the upper computer; the method further comprises the following steps:
the upper computer acquires read-write instructions corresponding to each embedded storage in the current processing cycle;
the instruction management module analyzes the group codes of the embedded storage device corresponding to the read-write instructions respectively to determine the current processing group codes corresponding to the read-write instructions;
the instruction management module inquires a current hash table corresponding to each current processing group code;
and sending the corresponding read-write instruction to each embedded storage device in the same group code in batch according to the current hash table.
The invention also provides an upper computer communication system suitable for the multi-model storage equipment, which applies any one of the upper computer communication methods suitable for the multi-model storage equipment; the upper computer communication system suitable for the multi-model storage equipment comprises an upper computer and embedded storage equipment.
Through above-mentioned technical scheme, can realize following beneficial effect:
after the upper computer generates the hash table, the data (namely the current value) stored in the embedded storage device by the parameter name (such as the current) to be read can be quickly read according to the hash table, or the data (namely the current value) stored in the embedded storage device by the parameter name (such as the current) to be modified can be quickly modified.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
Fig. 1 is a flowchart of a first embodiment of a host computer communication method applicable to multi-model storage devices according to the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides an upper computer communication method and system suitable for multi-model storage equipment.
As shown in fig. 1, in a first embodiment of a host computer communication method applicable to multi-type storage devices according to the present invention, the present embodiment is applied to a host computer communication system applicable to multi-type storage devices; the upper computer communication system suitable for the multi-model storage equipment comprises an upper computer and embedded storage equipment; the embodiment comprises the following steps:
step S110: after the upper computer communicates with the embedded storage device, the upper computer acquires a metadata description file in the embedded storage device, wherein the metadata description file comprises parameter names, and storage addresses and data lengths which respectively correspond to the parameter names.
Specifically, the metadata description file is represented in a json format, so that the upper computer can read the content in the metadata description file; the method includes that any type of embedded storage device is correspondingly provided with a metadata description file, the metadata description file is used for expressing format attributes of data stored in the corresponding embedded storage device, for example, a parameter name can be current or voltage, a storage address is an address corresponding to a data value of the current or a data value of the voltage and stored in the embedded storage device, and a data length is a byte length of the data value of the current or the data value of the voltage stored in the embedded storage device; of course, the parameter name here may be any other parameter; in practical applications, the storage address and data length of any parameter name in the embedded memory device are determined not to be changed once the cover is changed, and the actual data values (such as the data value of the current and the data value of the voltage) stored in the storage address are changed.
Step S120: the upper computer generates a corresponding hash table based on the metadata description file, wherein keys of the hash table are variable names, values of the hash table comprise storage addresses corresponding to the variable names and data lengths corresponding to the variable names, the storage addresses and the data lengths are spliced and combined to form the values of the hash table, and the variable names correspond to the parameter names one to one.
Specifically, the data structure is directly accessed from a Key value (Key value). That is, it accesses the record by mapping the key value to a location in the table to speed up the lookup; in this embodiment, the variable name is used as the key value, the value range of the variable name is consistent with that of the parameter name (that is, the variable name may also be set to be current or voltage), and the storage address and the data length of the parameter name corresponding to the consistency of the variable name are used as the access record, so as to speed up the search of the storage address and the data corresponding to the variable name.
Step S130: and the upper computer reads the data in the embedded storage equipment based on the hash table, or the upper computer modifies the data in the embedded storage equipment based on the hash table.
Specifically, after the hash table is generated, the upper computer can quickly read data (namely current value) stored in the embedded storage device by a parameter name (such as current) to be read according to the hash table, or quickly modify data (namely current value) stored in the embedded storage device by the parameter name (such as current) to be modified.
In a second embodiment of the upper computer communication method applicable to the multi-model storage device, based on the first embodiment, the metadata description file further includes a unit and a data type (taking the parameter name as an example, the unit is ampere, and the data type is an integer type) respectively corresponding to the parameter name; between step S120 and step S130, the following steps are included:
step S210: and the upper computer generates a data display interface based on the metadata description file, wherein the data display interface displays the parameter names and displays the data values, the storage addresses, the data lengths, the units and the data types which respectively correspond to the parameter names.
Specifically, in this embodiment, the data display interface displays the parameter names, and the data values (i.e., the specific values of the parameter names, which are also target data to be subsequently read or modified), the storage addresses, the data lengths, the units, and the data types corresponding to the parameter names in a table format.
In this embodiment, the parameter names, and the data values, the storage addresses, the data lengths, the units, and the data types corresponding to the parameter names are all displayed through the data display interface, so that managers can check and know the data stored in the embedded storage device in real time.
In a third embodiment of the upper computer communication method applicable to the multi-model storage device provided by the present invention, based on the second embodiment, the upper computer in step S130 reads data in the embedded storage device based on the hash table, and includes the following steps:
step S301: and the upper computer acquires the input reading instruction and the corresponding reading parameter name.
Specifically, the upper computer is in communication connection with an input device (such as a keyboard), and a manager inputs a reading instruction and a corresponding reading parameter name (such as current) through the input device, that is, the manager needs to read the current value stored in the embedded storage device at the moment.
Step S302: and the upper computer takes the read parameter name as the variable name based on the read instruction according to the hash table so as to obtain the storage address corresponding to the read parameter name and mark the storage address as a first target address, and obtain the data length corresponding to the read parameter name and mark the data length as a first target length.
Specifically, the upper computer uses the current as a variable name of the hash table to obtain a storage address corresponding to the current, and marks the storage address as a first target address (the first target address is a storage address at which the current value is stored in the embedded storage device), and obtains a data length corresponding to the current, and marks the data length as a first target length (the first target length is a storage length at which the current value is stored in the embedded storage device).
Step S303: and the upper computer sends the first target address and the first target length to the embedded storage equipment.
Step S304: and the embedded storage equipment reads the data with the length of the first target address as the first target length, and marks the read data as first target data.
Specifically, the embedded storage device directly reads data (i.e., current value) with a length of the first target length stored in the first target address of the embedded storage device, and marks the read data as the first target data.
Step S305: and the embedded storage equipment sends the first target data to the upper computer.
Step S306: and the upper computer displays the first target data in the display interface as the data value corresponding to the read parameter name.
Specifically, the obtained first target value is displayed on a display interface as the current value of the current, so that the complete operation of reading data is completed, and in the whole process, the upper computer does not need to communicate with the embedded storage device through a special communication protocol, so that the operation is simpler and more convenient.
The upper computer in the step S130 modifies the data in the embedded storage device based on the hash table, including the following steps:
step S307: the upper computer obtains an input modification instruction, and a modification parameter name and modification data corresponding to the modification instruction.
Specifically, the administrator inputs a modification instruction and a corresponding modification parameter name (such as voltage) through the input device, that is, the administrator needs to modify the voltage value stored in the embedded storage device at the moment.
Step S308: and the upper computer acquires the storage address corresponding to the modification parameter name according to the hash table based on the modification instruction, marks the storage address as a second target address, acquires the data length corresponding to the modification parameter name and marks the data length as a second target length.
Specifically, the upper computer uses the voltage as a variable name of the hash table to obtain a storage address corresponding to the voltage, and marks the storage address as a second target address (the second target address is a storage address where the voltage value is stored in the embedded storage device), and obtains a data length corresponding to the voltage, and marks the data length as a second target length (the second target length is a storage length where the voltage value is stored in the embedded storage device).
Step S309: and the upper computer sends the modified data, the second target address and the second target length to the embedded storage equipment.
Step S310: and the embedded storage equipment replaces the original data with the length of the second target address in the second target address with the modified data.
Specifically, the embedded storage device directly stores the modified data into the second target address and replaces original data (namely, the original voltage value) with the length being the length of the second target address, so that the complete operation of modifying the data is completed, and in the whole process, the upper computer does not need to communicate with the embedded storage device through a special communication protocol, so that the operation is simpler and more convenient.
In a fourth embodiment of the upper computer communication method applicable to the multi-model storage device provided by the invention, based on the third embodiment, the upper computer reads data in the embedded storage device based on the hash table, and further includes the following steps:
step S410: and the upper computer acquires the input specified parameter name.
Specifically, the manager inputs a specified parameter name (e.g., current) through the input device.
Step S420: and the upper computer takes the appointed parameter name as a variable name according to the Hash table so as to obtain the storage address corresponding to the appointed parameter name and mark the storage address as a third target address, and obtain the data length corresponding to the appointed parameter name and mark the data length as a third target length.
Specifically, the upper computer uses the current as a variable name of the hash table to obtain a storage address corresponding to the current, and marks the storage address as a second target address (the second target address is a storage address at which the current value is stored in the embedded storage device), and obtains a data length corresponding to the current, and marks the data length as a second target length (the second target length is a storage length at which the current value is stored in the embedded storage device).
Step S430: and the upper computer sends the third target address and the third target length to the embedded storage equipment.
Step S440: the embedded storage device obtains a first preset time period.
Specifically, the first preset time period is preferably 1 second.
Step S450: and the embedded storage equipment reads the data with the length of the third target address being the third target length once every first preset time period, and marks the read data as third target data.
Specifically, the embedded storage device reads the data (i.e., the current value) with the length of the third target address, which is stored in the third target address, once every 1 minute, and marks the read data as the third target data.
Step S460: and the embedded storage equipment sends the third target data to the upper computer every other first preset time period.
Specifically, the embedded storage device sends the read third target data to the upper computer every 1 minute.
Step S470: and the upper computer displays the third target data as the data value corresponding to the specified parameter name in the display interface, and updates the third target data every other first preset time period.
Specifically, the upper computer takes the received third target data as a parameter name and carries out updating display on the display interface every 1 minute, and therefore the upper computer can update the current value continuously in real time, and managers can monitor the work acquisition data of each embedded storage device in real time conveniently.
In a fifth embodiment of the upper computer communication method applicable to the multi-model storage device, based on the fourth embodiment, the embedded storage device further includes a computing module; step S440, including the steps of:
step S510: the calculation module acquires the total amount of the third target data in a preset second time period in the past.
Specifically, the preset second time period is preferably 24 hours, that is, the total amount of the third target data, that is, the number of the third target data received by the upper computer in the last 24 hours is obtained by the calculation module, in this embodiment, the number of the third target data is 1440 since the third target data is sent every 1 second.
Step S520: the calculation module obtains an average value of the third target data in a second time period preset in the past.
Specifically, the calculation module obtains an average value of the values of the 1440 third target data in the last 24 hours.
Step S530: and the calculating module acquires the number of differences between the average value and each third target data in the past preset second time period, wherein the number of the differences is larger than a preset difference value, and the number of the differences is marked as a mutation number, wherein the preset difference value is a preset percentage of the average value.
Specifically, the preset percentage is preferably 20%, that is, the calculation module obtains the number of differences between the average value and each third target data in the last 24 hours, which is greater than the preset difference value, and marks the number as the number of sudden changes, where the number of sudden changes is the number of differences between the current value and the average value.
Step S540: the calculation module generates the first preset time period according to a ratio of the mutation number to the total number, wherein the first preset time period is smaller when the ratio is larger, and the first preset time period is larger when the ratio is smaller.
Specifically, the larger the ratio in this embodiment is, the larger the actual value change of the current value in the past 24 hours is, and the fluctuation is larger, so that the first preset time period needs to be reduced, that is, the number of the third target data acquired by the upper computer in the unit time is increased, so as to acquire more detailed and specific third target data, and thereby, the reason for the larger fluctuation is analyzed; on the contrary, the smaller the ratio is, the smaller the actual value change of the current value in the last 24 hours is, the smaller the fluctuation is, that is, the value of the third target data is relatively stable, so that the first preset time period can be increased, the number of the third target data acquired by the upper computer in unit time is reduced, the network communication burden is reduced, and the operating efficiency of the upper computer is improved.
In a sixth embodiment of the upper computer communication method applicable to the multi-model storage device, based on the first embodiment, the embedded storage device further includes a computing module; step S110, the method further includes the following steps:
step S610: and the embedded storage equipment stores the MAC address received for the first time and marks the MAC address as a safe address.
Specifically, each time the upper computer is in communication connection with the embedded storage device, the embedded storage device acquires the MAC address of the upper computer, and the embedded storage device stores the MAC address received for the first time and marks the MAC address as a secure address; namely, the upper computer which is in communication connection with the embedded storage device for the first time is a safe upper computer.
Step S620: and the upper computer is in communication connection with the embedded storage equipment.
Step S630: and the upper computer sends the MAC address of the upper computer to the embedded storage equipment.
Step S640: and the computing module judges whether the MAC address of the upper computer in the current communication connection is consistent with the safety address.
Specifically, the calculation module judges whether the MAC address of the upper computer in the current communication connection is consistent with the safety address; so as to judge whether the upper computer of the current communication connection is a safe upper computer.
If yes, go to step S650: and allowing the upper computer to execute the step of acquiring the metadata description file in the embedded storage device in the step S110.
If not, go to step S660: and not allowing the upper computer to execute the step of acquiring the metadata description file in the embedded storage device in the step S110.
Specifically, if not, it is indicated that the current upper computer is not a secure upper computer, so that the current upper computer is not allowed to acquire the metadata description file of the embedded storage device, so as to improve data security.
In a seventh embodiment of the upper computer communication method applicable to the multi-model storage device, based on the third embodiment, the embedded storage device further includes a computing module; this embodiment further includes the following steps:
step S710: the calculation module obtains the total number of the parameter names in the metadata description file
Figure 746139DEST_PATH_IMAGE001
Specifically, the calculation module obtains the total number of parameters stored in the embedded storage device, for example, 30 parameters.
Step S720: the computing module obtains the total times of modifying the data in the embedded storage device in the third preset time period in the past
Figure 451796DEST_PATH_IMAGE002
Specifically, the total number of times of modifying the data in the embedded storage device, for example, 60 times, within the third preset time period (preferably 12 hours) obtained by the calculation module.
Step S730: the calculation module calculates a data risk coefficient D at the current moment:
Figure 941683DEST_PATH_IMAGE004
wherein the content of the first and second substances,
Figure 534338DEST_PATH_IMAGE003
in order to be said risk factor,
Figure 349847DEST_PATH_IMAGE005
in order to modify the times that the interval time of the data in the embedded storage device is less than the preset time (preferably 5 seconds) within the third preset time period in the past, the value is greater than or equal to 0;
Figure 44265DEST_PATH_IMAGE006
storing the modified data into the same second target address within the third preset time period in the past, wherein the value is greater than or equal to 0;
Figure 603422DEST_PATH_IMAGE007
and taking the value of the second target address of which the modified data is stored in the third preset time period in the past to be greater than or equal to 0.
Specifically, the above formula is used for calculating a data risk coefficient in the embedded storage device, where the maximum value of the risk coefficient is 3, and the closer to 3, the more dangerous the data is; the specific analysis is as follows: due to the fact that
Figure 316163DEST_PATH_IMAGE001
Is determined if
Figure 36995DEST_PATH_IMAGE007
The larger the address at which the modified data occurs in the embedded memory device, the more abnormal the data modification, since it is usually necessary to modify several common parameters,
Figure 982823DEST_PATH_IMAGE007
up to 30, i.e. 30 parameters have been modified, and, at this point,
Figure 814513DEST_PATH_IMAGE008
taking 1; due to the fact that
Figure 647340DEST_PATH_IMAGE002
Is determined if
Figure 539072DEST_PATH_IMAGE005
The larger the data, the larger the number of data modifications occurring within the past 12 hours with an interval time of less than 5 seconds, the more abnormal such data modifications are, if any
Figure 208082DEST_PATH_IMAGE006
The larger the number of modifications made to the same parameter, the more unusual,
Figure 374621DEST_PATH_IMAGE009
the maximum may be 1.
Step S740: and when the data danger coefficient is larger than a critical value, the embedded storage equipment is disconnected from the communication connection with the upper computer.
Specifically, in this embodiment, the critical value is 2, and when the risk factor is greater than 2, it indicates that the number of abnormal modifications is too many in the past 12 hours, that is, the embedded storage device disconnects the communication connection with the upper computer for data security.
In an eighth embodiment of the upper computer communication method applicable to the multi-model storage devices, based on the first embodiment, the upper computer communication system applicable to the multi-model storage devices includes a plurality of storage subgroups, each storage subgroup has a unique group identifier, each storage subgroup has one or more embedded storage devices, and each embedded storage device in each storage subgroup has the same metadata storage rule, where the same metadata storage rule includes: the storage addresses corresponding to the same parameter name are the same and the corresponding data lengths are the same; the embodiment further comprises the following steps:
step S810: the method comprises the steps of obtaining a group code of the embedded storage device which is communicated with the upper computer, and obtaining a metadata description file of the embedded storage device which is communicated with the upper computer.
Step S820: and generating the metadata description file and the corresponding hash table of each embedded storage device in the same group code in the upper computer according to the metadata description file of the embedded storage device and the group code which are communicated with the upper computer.
Specifically, in the same group code, as long as the upper computer generates a hash table corresponding to one embedded storage device, the hash table can be used as a hash table of other embedded storage devices in the same group code, that is, the group code and the hash table form a corresponding relationship; the metadata description files of other embedded storage devices in the same group of codes do not need to be acquired independently to generate the hash table, and operation is simplified.
In a ninth embodiment of the upper computer communication method applicable to the multi-model storage device, based on the eighth embodiment, the upper computer communication system applicable to the multi-model storage device includes an instruction management module arranged in the upper computer; the embodiment further comprises the following steps:
step S910: and the upper computer acquires the read-write instructions corresponding to the embedded memories in the current processing cycle.
Specifically, the processing cycle is defined by time, for example, 1 minute is 1 processing cycle, the upper computer obtains the read-write instructions corresponding to each embedded storage device within 1 minute, and the read-write instructions are input by the administrator through the upper computer.
Step S920: the instruction management module analyzes the group codes of the embedded storage device corresponding to the read-write instructions respectively to determine the current processing group codes corresponding to the read-write instructions.
Specifically, the instruction management module classifies all the read-write instructions in the current processing cycle according to the group codes to determine the current processing group codes corresponding to each read-write instruction.
Step S930: and the instruction management module inquires the current hash table corresponding to each current processing group code.
Specifically, the instruction management module queries a current hash table corresponding to each of the currently processed group codes.
Step S940: and sending the corresponding read-write instruction to each embedded storage device in the same group code in batch according to the current hash table.
Specifically, generally speaking, the upper computer can only send out one read-write command at a time. The upper computer queries a hash table corresponding to the embedded storage device after sending a read-write instruction, determines the storage address and the data length of read-write parameters through the hash table, and then performs corresponding read-write reference based on the storage address and the data length; according to the scheme provided by the embodiment, all read-write instructions in one processing cycle are firstly classified according to the group codes, only one hash table needs to be searched for the read-write instructions of the embedded storage devices in the same group, the hash table does not need to be searched for each read-write instruction, after the hash table is searched, the mapping relation is established between the storage address and the data length obtained by searching the hash table and the read-write instructions of the same group code in the same processing cycle, and then the read-write instructions in the processing cycle are sent to the embedded storage devices of the same group code at the same time, so that batch data read-write of the embedded storage devices in the same group code is realized.
In a tenth embodiment of the upper computer communication method applicable to the multi-model storage device, based on the ninth embodiment, the present embodiment further includes the following steps:
step S1010: and determining variable names to be read and written in batch by the upper computer, and inquiring a hash table corresponding to each group of codes according to the variable names.
Specifically, for example, in practical application, voltage values of all embedded storage devices need to be read in batch, so that the voltage is determined as a variable name to be read and written by the upper computer in batch, and then the hash table corresponding to each group of codes is queried for the variable name.
Step S1020: and the upper computer acquires data corresponding to the variable names of all the embedded storage devices in the same storage group in batches based on the hash table corresponding to each group code.
Specifically, the upper computer queries the storage address and the data length of the voltage value stored in the embedded storage device corresponding to each group code based on the hash table corresponding to each group code, and then obtains the data (namely the voltage value) corresponding to the voltage of each embedded storage device in the same storage group in batches based on the storage address and the data length, so that the operation can realize the batch fast reading of the data in the multiple embedded storage devices, and the operation is simpler and more convenient and faster.
The invention also provides an upper computer communication system suitable for the multi-model storage equipment, which applies the upper computer communication method suitable for the multi-model storage equipment; the upper computer communication system suitable for the multi-model storage equipment comprises an upper computer and embedded storage equipment.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, wherein the software product is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (9)

1. A communication method of an upper computer suitable for multi-model storage equipment is characterized in that the method is applied to a communication system of the upper computer suitable for the multi-model storage equipment; the upper computer communication system suitable for the multi-model storage equipment comprises an upper computer and embedded storage equipment; the embedded storage device also comprises a computing module; the method comprises the following steps:
after the upper computer communicates with the embedded storage equipment, the upper computer acquires a metadata description file in the embedded storage equipment, wherein the metadata description file comprises parameter names, storage addresses and data lengths which respectively correspond to the parameter names, and once the storage addresses and the data lengths of any parameter name in the embedded storage equipment are determined not to be changed, the changed storage addresses and data lengths are actual data values stored in the storage addresses;
the upper computer generates a corresponding hash table based on the metadata description file, wherein keys of the hash table are variable names, values of the hash table comprise the storage addresses corresponding to the variable names and the data lengths corresponding to the variable names, and the storage addresses and the data lengths are spliced and combined to form the values of the hash table, wherein the variable names correspond to the parameter names one to one;
the upper computer reads the data in the embedded storage equipment based on the hash table, or the upper computer modifies the data in the embedded storage equipment based on the hash table;
after the upper computer communicates with the embedded storage device, the upper computer acquires a metadata description file in the embedded storage device, and the method also comprises the following steps:
the embedded storage equipment stores the MAC address received for the first time and marks the MAC address as a safe address;
the upper computer is in communication connection with the embedded storage device;
the upper computer sends the MAC address of the upper computer to the embedded storage equipment;
the computing module judges whether the MAC address of the upper computer in the current communication connection is consistent with the safe address;
if yes, allowing the upper computer to execute the step of acquiring the metadata description file in the embedded storage equipment;
if not, the step that the upper computer acquires the metadata description file in the embedded storage equipment is not allowed to be executed.
2. The upper computer communication method applicable to multi-model storage devices according to claim 1, wherein the metadata description file further comprises units and data types respectively corresponding to the parameter names; the steps that the upper computer generates a corresponding hash table based on the metadata description file and the upper computer reads the data in the embedded storage equipment based on the hash table, or the upper computer modifies the data in the embedded storage equipment based on the hash table include:
and the upper computer generates a data display interface based on the metadata description file, wherein the data display interface is used for displaying the parameter names and displaying the data values, the storage addresses, the data lengths, the units and the data types which respectively correspond to the parameter names.
3. The communication method of the upper computer suitable for the multi-model storage device according to claim 2, wherein the upper computer reads the data in the embedded storage device based on the hash table, and the method comprises the following steps:
the upper computer acquires an input reading instruction and a corresponding reading parameter name;
the upper computer takes the read parameter name as the variable name according to the hash table based on the read instruction, so as to obtain the storage address corresponding to the read parameter name and mark the storage address as a first target address, and obtain the data length corresponding to the read parameter name and mark the data length as a first target length;
the upper computer sends the first target address and the first target length to the embedded storage device;
the embedded storage equipment reads the data with the length of the first target address as the length of the first target address, and marks the read data as first target data;
the embedded storage equipment sends the first target data to the upper computer;
the upper computer displays the first target data as the data value corresponding to the read parameter name in the display interface;
the host computer modifies the data in the embedded storage device based on the hash table, and the method comprises the following steps:
the upper computer acquires an input modification instruction, and a modification parameter name and modification data corresponding to the modification instruction;
the upper computer acquires the storage address corresponding to the modification parameter name according to the hash table based on the modification instruction, marks the storage address as a second target address, acquires the data length corresponding to the modification parameter name, and marks the data length as a second target length;
the upper computer sends the modified data, the second target address and the second target length to the embedded storage device;
and the embedded storage equipment replaces the original data with the length of the second target address in the second target address with the modified data.
4. The upper computer communication method suitable for the multi-model storage device according to claim 3, wherein the upper computer reads data in the embedded storage device based on the hash table, further comprising:
the upper computer acquires an input specified parameter name;
the upper computer takes the appointed parameter name as a variable name according to the Hash table so as to obtain the storage address corresponding to the appointed parameter name and mark the storage address as a third target address, and obtain the data length corresponding to the appointed parameter name and mark the data length as a third target length;
the upper computer sends the third target address and the third target length to the embedded storage device;
the embedded storage equipment acquires a first preset time period;
the embedded storage device reads the data with the length of the third target address being the third target length once every other first preset time period, and marks the read data as third target data;
the embedded storage equipment sends the third target data to the upper computer every other first preset time period;
and the upper computer displays the third target data as the data value corresponding to the specified parameter name in the display interface, and updates the third target data every other first preset time period.
5. The upper computer communication method suitable for the multi-model storage device according to claim 4, wherein the embedded storage device further comprises a computing module; the embedded storage device acquires a first preset time period, and comprises:
the calculation module acquires the total amount of the third target data in a second time period preset in the past;
the calculation module acquires an average value of the third target data in a second time period preset in the past;
the calculation module acquires the number of differences between each third target data and the average value in the past preset second time period, wherein the number of the differences is larger than a preset difference value, and the differences are marked as mutation numbers, wherein the preset difference value is a preset percentage of the average value;
the calculation module generates the first preset time period according to a ratio of the mutation number to the total number, wherein the first preset time period is smaller when the ratio is larger, and the first preset time period is larger when the ratio is smaller.
6. The upper computer communication method suitable for the multi-model storage device according to claim 3, wherein the embedded storage device further comprises a computing module; the upper computer communication method suitable for the multi-model storage equipment further comprises the following steps:
the calculation module obtains the total number of the parameter names in the metadata description file
Figure DEST_PATH_IMAGE001
The computing module obtains the total times of modifying the data in the embedded storage device in the third preset time period in the past
Figure 255032DEST_PATH_IMAGE002
The calculation module calculates a data risk coefficient D at the current moment:
Figure DEST_PATH_IMAGE003
wherein the content of the first and second substances,
Figure 296806DEST_PATH_IMAGE004
in order to be said risk factor,
Figure DEST_PATH_IMAGE005
for the times that the interval time for modifying the data in the embedded storage device in the third preset time period in the past is less than the preset time length, the value is greater than or equal to 0;
Figure 434133DEST_PATH_IMAGE006
storing the modified data into the same second target address within the third preset time period in the past, wherein the value is greater than or equal to 0;
Figure DEST_PATH_IMAGE007
taking the value of the second target address of which the modified data is stored in the third preset time period in the past to be greater than or equal to 0;
and when the data danger coefficient is larger than a critical value, the embedded storage equipment is disconnected from the communication connection with the upper computer.
7. The upper computer communication method applicable to the multi-model storage devices according to claim 1, wherein the upper computer communication system applicable to the multi-model storage devices comprises a plurality of storage subgroups, each storage subgroup has a unique group code, each storage subgroup has one or more embedded storage devices therein, and each embedded storage device in each storage subgroup has the same metadata storage rule, wherein the same metadata storage rule comprises: the storage addresses corresponding to the same parameter name are the same and the corresponding data lengths are the same; the method further comprises the following steps:
acquiring a group code of the embedded storage equipment which establishes communication with the upper computer, and acquiring a metadata description file of the embedded storage equipment which establishes communication with the upper computer;
and generating the metadata description file and the corresponding hash table of each embedded storage device in the same group code in the upper computer according to the metadata description file of the embedded storage device and the group code which are communicated with the upper computer.
8. The upper computer communication method suitable for the multi-model storage devices according to claim 7, wherein the upper computer communication system suitable for the multi-model storage devices comprises an instruction management module arranged in the upper computer; the method further comprises the following steps:
the upper computer acquires read-write instructions corresponding to each embedded storage in the current processing cycle;
the instruction management module analyzes the group codes of the embedded storage device corresponding to the read-write instructions respectively to determine the current processing group codes corresponding to the read-write instructions;
the instruction management module inquires a current hash table corresponding to each current processing group code;
and sending the corresponding read-write instruction to each embedded storage device in the same group code in batch according to the current hash table.
9. An upper computer communication system suitable for multi-model storage equipment is characterized in that the upper computer communication method suitable for the multi-model storage equipment is applied according to any one of claims 1 to 8; the upper computer communication system suitable for the multi-model storage equipment comprises an upper computer and embedded storage equipment.
CN202110581363.9A 2021-05-27 2021-05-27 Upper computer communication method and system suitable for multi-model storage equipment Active CN113031880B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110581363.9A CN113031880B (en) 2021-05-27 2021-05-27 Upper computer communication method and system suitable for multi-model storage equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110581363.9A CN113031880B (en) 2021-05-27 2021-05-27 Upper computer communication method and system suitable for multi-model storage equipment

Publications (2)

Publication Number Publication Date
CN113031880A CN113031880A (en) 2021-06-25
CN113031880B true CN113031880B (en) 2021-08-17

Family

ID=76455752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110581363.9A Active CN113031880B (en) 2021-05-27 2021-05-27 Upper computer communication method and system suitable for multi-model storage equipment

Country Status (1)

Country Link
CN (1) CN113031880B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886612A (en) * 2017-04-21 2017-06-23 厦门华厦学院 A kind of big data acquisition analysis system
CN112667165A (en) * 2020-12-29 2021-04-16 湖南博匠信息科技有限公司 Data storage system and data storage method thereof
CN112667164A (en) * 2020-12-30 2021-04-16 湖南博匠信息科技有限公司 Shared storage unit management monitoring method and system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100524312C (en) * 2007-01-10 2009-08-05 凤凰微电子(中国)有限公司 Mass storing and managing method of smart card
CN101770431A (en) * 2008-12-30 2010-07-07 创惟科技股份有限公司 Storage device capable of certifying and data protection method
CN101739594B (en) * 2009-12-28 2013-08-28 中国人民解放军总后勤部军事交通运输研究所 Sensor virtual spreadsheet-based self-descriptive sensing tag system
CN104346357B (en) * 2013-07-29 2018-02-13 中国科学院声学研究所 The file access method and system of a kind of built-in terminal
CN104104674A (en) * 2014-07-01 2014-10-15 广东艾科技术股份有限公司 Multiprotocol distributed data acquisition control system of equipment sensor and method thereof
CN105243071A (en) * 2014-07-12 2016-01-13 航天恒星科技有限公司 Retrievable file access method suitable for no-file system
CN114089916B (en) * 2018-01-12 2022-12-20 珠海极海半导体有限公司 Data acquisition system and temperature and humidity sensor system
CN110334140B (en) * 2019-05-24 2022-04-08 深圳绿米联创科技有限公司 Method and device for processing data reported by equipment and server
CN111221776B (en) * 2019-12-30 2023-06-23 上海交通大学 Method, system and medium for realizing file system oriented to nonvolatile memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886612A (en) * 2017-04-21 2017-06-23 厦门华厦学院 A kind of big data acquisition analysis system
CN112667165A (en) * 2020-12-29 2021-04-16 湖南博匠信息科技有限公司 Data storage system and data storage method thereof
CN112667164A (en) * 2020-12-30 2021-04-16 湖南博匠信息科技有限公司 Shared storage unit management monitoring method and system

Also Published As

Publication number Publication date
CN113031880A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
US8954641B2 (en) Method and apparatus for establishing communication
JP2015087852A (en) Industrial equipment management system, industrial equipment management apparatus, industrial equipment management method, program, and information storage medium
CN112055062B (en) Data communication method, device, equipment and readable storage medium
CN112988317B (en) Multi-mode cloud desktop management and control method and device
CN112105009A (en) Device discovery and Bluetooth broadcasting method, device, electronic device and storage medium
CN111814065A (en) Information propagation path analysis method and device, computer equipment and storage medium
CN112988770A (en) Method and device for updating serial number, electronic equipment and storage medium
CN113031880B (en) Upper computer communication method and system suitable for multi-model storage equipment
CN113739382A (en) Air conditioner control method and device, control equipment and storage medium
CN112764874B (en) Virtual machine server information acquisition method based on CMDB configuration management system
CN112799955B (en) Method and device for detecting model change, storage medium and electronic equipment
CN112788576B (en) Equipment offline processing method and system, storage medium and electronic device
CN116360809B (en) Remote firmware upgrading method, system and medium for embedded intelligent terminal
WO2024001572A1 (en) Controller function updating method and system, vehicle, and server
CN112685115A (en) International cue language generating method, system, computer equipment and storage medium
CN114745267B (en) Function updating method and related device
CN112000618B (en) File change management method, device, equipment and storage medium for cluster nodes
CN113050980B (en) Function configuration information acquisition method and device and computer readable storage medium
CN112351420B (en) Networking identity creation method and equipment of terminal equipment and readable storage medium
US20130103724A1 (en) Network and method for managing models
JPH11149403A (en) Data sharing system and data shared network system
CN111090804B (en) Data filtering method, device and computer storage medium
JP2000244551A (en) Gateway device
CN113064881B (en) Database management method, device, equipment and readable storage medium
CN117675976A (en) Equipment monitoring method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant