[go: up one dir, main page]

CN115603901B - A key updating method, device, acquisition terminal device and storage medium - Google Patents

A key updating method, device, acquisition terminal device and storage medium Download PDF

Info

Publication number
CN115603901B
CN115603901B CN202211191113.5A CN202211191113A CN115603901B CN 115603901 B CN115603901 B CN 115603901B CN 202211191113 A CN202211191113 A CN 202211191113A CN 115603901 B CN115603901 B CN 115603901B
Authority
CN
China
Prior art keywords
execution
key
sending
data
operation instruction
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
CN202211191113.5A
Other languages
Chinese (zh)
Other versions
CN115603901A (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.)
Hangzhou Hexing Electrical Co Ltd
Original Assignee
Hangzhou Renhe 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 Hangzhou Renhe Information Technology Co ltd filed Critical Hangzhou Renhe Information Technology Co ltd
Priority to CN202211191113.5A priority Critical patent/CN115603901B/en
Publication of CN115603901A publication Critical patent/CN115603901A/en
Application granted granted Critical
Publication of CN115603901B publication Critical patent/CN115603901B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0891Revocation or update of secret information, e.g. encryption key update or rekeying
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种秘钥更新方法、装置、采集终端设备以及计算机可读存储介质,涉及电力领域,其中方法包括:接收秘钥更新任务参数和表档案信息;根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令;根据所述执行指令,设置所述表秘钥并接收返回的执行数据;根据所述执行数据,发送读取所述表秘钥的CRC的操作指令;根据所述操作指令,读取所述表秘钥的所述CRC并接收返回的读取数据;根据所述读取数据,进行CRC验证,完成所述秘钥更新;本发明通过在采集终端中操作,保证执行秘钥更新的功能并发进行互不干扰,实现功能解耦,并且本发明中通过CRC校验来进行秘钥更新的验证,可以保障电能表完成秘钥更新。

The present invention discloses a key updating method, device, acquisition terminal equipment and computer-readable storage medium, and relates to the electric power field, wherein the method comprises: receiving key updating task parameters and table file information; sending an execution instruction for setting a table key according to the key updating task parameters and the table file information; setting the table key according to the execution instruction and receiving returned execution data; sending an operation instruction for reading CRC of the table key according to the execution data; reading the CRC of the table key according to the operation instruction and receiving returned read data; performing CRC verification according to the read data to complete the key updating; the present invention ensures that the functions of executing key updating are performed concurrently without interfering with each other by operating in the acquisition terminal, thereby realizing functional decoupling, and the key updating is verified by CRC verification in the present invention, so as to ensure that the electric energy meter completes the key updating.

Description

一种秘钥更新方法、装置、采集终端设备以及存储介质A method and device for updating a secret key, a collection terminal device and a storage medium

技术领域Technical Field

本发明涉及电力领域,特别涉及一种秘钥更新方法、装置、采集终端设备以及计算机可读存储介质。The present invention relates to the electric power field, and in particular to a key updating method, device, acquisition terminal equipment and computer-readable storage medium.

背景技术Background Art

在电力行业采集系统中,存在系统主站、采集终端以及电能表三个部分。系统主站通过采集终端或者采集终端本身都可以对电能表进行参数读写、数据读取、控制等操作,其通讯以报文的形式存在,为了完全起见,报文往往是被加密的数据,其中,对数据的加密需要用到秘钥,可以是所有的电能表共用一个秘钥,也可以是每个表都是不同的秘钥,为了提高秘钥的使用安全性,可以随时更改秘钥。In the power industry data collection system, there are three parts: the system master station, the data collection terminal, and the energy meter. The system master station can read and write parameters, read data, and control the energy meter through the data collection terminal or the data collection terminal itself. Its communication exists in the form of messages. For the sake of completeness, the messages are often encrypted data. Among them, the encryption of data requires a secret key. All energy meters can share a secret key, or each meter can have a different secret key. In order to improve the security of the use of the secret key, the secret key can be changed at any time.

目前现有两种更新秘钥的方法,一种为系统主站通过采集终端,将新秘钥设置到每一个电能表,电能表返回设置的结果,系统主站根据返回的结果,更新界面上的状态显示。这种用系统主站直接对电能表进行秘钥更新的方法,会导致一直占用系统主站的资源,主站上的其他功能会受到影响,而且通讯涉及系统主站、采集终端以及电能表三个层面,导致一个报文的通讯时间增长,整个系统响应迟缓。There are currently two methods for updating the secret key. One is that the system master station sets the new secret key to each energy meter through the acquisition terminal. The energy meter returns the result of the setting, and the system master station updates the status display on the interface according to the returned result. This method of using the system master station to directly update the secret key of the energy meter will cause the system master station's resources to be occupied all the time, and other functions on the master station will be affected. In addition, the communication involves the system master station, the acquisition terminal, and the energy meter at three levels, which increases the communication time of a message and slows down the response of the entire system.

另一种为系统主站把要更新的电能表信息及秘钥下发给采集终端,由采集终端执行秘钥更新任务,再上报结果给系统主站,系统主站进行界面的状态更新。但是,按目前各大厂家的采集终端来看,基本都是使用一个任务执行完所有的电能表秘钥更新功能。就目前市场上使用的高速载波通讯方案来说,没有体现并发的功能,整体通讯速度没有合理的利用。而且设置秘钥后,由于秘钥是只写模式,所以并不能通过读取秘钥来确认是否设置成功。仅通过电能表返回确认,就认为是设置成功,并没有通过其他方式去再次确认,无法确定是否设置成功。The other is that the system master sends the energy meter information and secret key to be updated to the collection terminal, and the collection terminal executes the secret key update task, and then reports the result to the system master, and the system master updates the status of the interface. However, according to the current collection terminals of major manufacturers, basically all energy meter secret key update functions are executed using one task. As for the high-speed carrier communication solutions currently used in the market, there is no concurrent function, and the overall communication speed is not reasonably utilized. Moreover, after setting the secret key, since the secret key is in write-only mode, it is not possible to confirm whether the setting is successful by reading the secret key. It is considered that the setting is successful only through the confirmation returned by the energy meter, and it is not confirmed again by other means, so it is impossible to determine whether the setting is successful.

发明内容Summary of the invention

本发明的目的是提供一种秘钥更新方法、装置、采集终端设备以及计算机可读存储介质,本发明通过在采集终端中操作,保证执行秘钥更新的功能并发进行互不干扰,实现功能解耦,并且本发明中通过CRC校验来进行秘钥更新的验证,可以保障电能表真正的完成秘钥更新。The purpose of the present invention is to provide a key update method, device, acquisition terminal equipment and computer-readable storage medium. The present invention ensures that the functions of executing key updates are performed concurrently without interfering with each other by operating in the acquisition terminal, thereby realizing functional decoupling. In addition, the key update is verified by CRC check in the present invention, which can ensure that the electric energy meter truly completes the key update.

依据本发明的一个方面,本发明提供了一种秘钥更新方法,应用于采集终端,包括:According to one aspect of the present invention, the present invention provides a key update method, which is applied to a collection terminal, comprising:

一种秘钥更新的方法,其特征在于,应用于采集终端,包括:A method for updating a secret key, characterized in that it is applied to a collection terminal and comprises:

接收秘钥更新任务参数和表档案信息;Receive key update task parameters and table file information;

根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令;Sending an execution instruction for setting a table key according to the key update task parameters and the table archive information;

根据所述执行指令,设置所述表秘钥并接收返回的执行数据;According to the execution instruction, setting the table key and receiving returned execution data;

根据所述执行数据,发送读取所述表秘钥的CRC的操作指令;According to the execution data, sending an operation instruction for reading the CRC of the table key;

根据所述操作指令,读取所述表秘钥的所述CRC并接收返回的读取数据;According to the operation instruction, read the CRC of the table key and receive the returned read data;

根据所述读取数据,进行CRC验证,完成所述秘钥更新。According to the read data, CRC verification is performed to complete the key update.

可选地,所述发送设置表秘钥的执行指令,包括:Optionally, the sending of the execution instruction for setting the table key includes:

检测策略执行临时区是否有所述操作指令;Check whether the strategy execution temporary area has the operation instruction;

若有所述操作指令,则发送所述操作指令;If there is the operation instruction, sending the operation instruction;

若没有所述操作指令,则检测策略执行队列是否所述执行数据;If there is no such operation instruction, then checking whether the strategy execution queue contains the aforementioned execution data;

若有所述执行数据,则根据提取的所述执行数据,产生并发送所述操作指令;If the execution data exists, generating and sending the operation instruction according to the extracted execution data;

若没有所述执行数据,则利用策略提取器产生设置所述表秘钥的所述执行指令,并发送所述执行指令。If the execution data does not exist, the policy extractor is used to generate the execution instruction for setting the table key, and the execution instruction is sent.

可选地,所述若有所述操作指令,则发送所述操作指令之后,还包括:Optionally, if the operation instruction is present, after sending the operation instruction, the method further includes:

检测是否发送成功;Check whether the sending is successful;

若发送成功,则将所述策略执行临时区清空;If the sending is successful, the policy execution temporary area is cleared;

若发送不成功,则不清空所述策略执行临时区并等待预设时间后继续发送。If the sending is unsuccessful, the policy execution temporary area will not be cleared and the sending will continue after waiting for a preset time.

可选地,所述根据提取的所述执行数据,产生并发送所述操作指令之后,包括:Optionally, after generating and sending the operation instruction according to the extracted execution data, the method further comprises:

若抄读执行队列中的指令数量达到预设值,则将产生的一条所述操作指令存入所述策略执行临时区。If the number of instructions in the copy execution queue reaches a preset value, a generated operation instruction is stored in the strategy execution temporary area.

可选地,所述根据所述执行数据,发送读取所述表秘钥的CRC的操作指令,包括:Optionally, sending an operation instruction for reading the CRC of the table key according to the execution data includes:

判断执行结果是否为超时;Determine whether the execution result is timeout;

若所述执行结果为超时,则判断执行次数;If the execution result is a timeout, determining the number of executions;

若所述执行次数小于预设数值,则发送所述执行指令;If the execution times are less than a preset value, sending the execution instruction;

若所述执行次数等于所述预设数值,则将失败事件上报系统主站;If the execution times are equal to the preset value, the failure event is reported to the system master station;

若所述执行结果不为超时,则发送读取所述表秘钥的所述CRC的所述操作指令。If the execution result is not a timeout, sending the operation instruction for reading the CRC of the table key.

可选地,所述根据所述读取数据,进行CRC验证,完成所述秘钥更新,包括:Optionally, performing CRC verification according to the read data to complete the key update includes:

若执行结果为成功,则进行所述CRC验证,完成所述秘钥更新;If the execution result is successful, the CRC verification is performed to complete the key update;

若所述执行结果为失败,则将失败事件上报所述系统主站。If the execution result is failure, the failure event is reported to the system master station.

判断所述执行结果是否为超时;Determine whether the execution result is a timeout;

若所述执行结果为超时,则判断执行次数;If the execution result is a timeout, determining the number of executions;

若所述执行次数小于预设数值,则发送所述操作指令;If the execution times are less than a preset value, sending the operation instruction;

若所述执行次数等于所述预设数值,则将失败事件上报所述系统主站。If the execution times are equal to the preset value, the failure event is reported to the system master station.

可选地,所述根据所述读取数据,进行CRC验证,完成所述秘钥更新,包括:Optionally, performing CRC verification according to the read data to complete the key update includes:

对比所述表秘钥的所述CRC值和数据库中秘钥的CRC值是否相符;Compare the CRC value of the table key with the CRC value of the key in the database to see if they match;

若相符,则将结果发送至所述系统主站,完成所述秘钥更新。If they match, the result is sent to the system master station to complete the key update.

可选地,所述根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令,包括:Optionally, sending an execution instruction for setting a table key according to the key update task parameter and the table archive information includes:

对比所述秘钥更新任务参数与所述表档案信息是否相符;Comparing the key update task parameters with the table file information to see if they are consistent;

若相符,则确定进行秘钥更新的电能表并发送设置所述表秘钥的所述执行指令。If they match, the electric energy meter for which the secret key is to be updated is determined and the execution instruction for setting the table secret key is sent.

本发明提供一种秘钥更新装置,包括:The present invention provides a key updating device, comprising:

接收模块,用于接收秘钥更新任务参数和表档案信息;A receiving module, used to receive key update task parameters and table file information;

第一发送模块,用于根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令;A first sending module, used for sending an execution instruction for setting a table secret key according to the secret key update task parameters and the table archive information;

设置秘钥模块,用于根据所述执行指令,设置所述表秘钥并接收返回的执行数据;A key setting module, used for setting the table key according to the execution instruction and receiving the returned execution data;

第二发送模块,用于根据所述执行数据,发送读取所述表秘钥的CRC的操作指令;A second sending module, used for sending an operation instruction for reading the CRC of the table key according to the execution data;

读取秘钥模块,用于根据所述操作指令,读取所述表秘钥的所述CRC并接收返回的读取数据;A key reading module, used for reading the CRC of the table key and receiving returned read data according to the operation instruction;

验证模块,用于根据所述读取数据,进行CRC验证,完成所述秘钥更新。The verification module is used to perform CRC verification based on the read data to complete the key update.

本发明提供一种采集终端设备,包括:The present invention provides a collection terminal device, comprising:

存储器,用于存储计算机程序;Memory for storing computer programs;

处理器,用于执行所述计算机程序时实现如上述所述的字段转换方法。A processor is used to implement the field conversion method as described above when executing the computer program.

本发明提供一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机可执行指令,所述计算机可执行指令被处理器加载并执行时,实现如上述所述的秘钥更新方法的步骤。The present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the steps of the key updating method as described above are implemented.

可见,本发明通过在采集终端中操作,保证执行秘钥更新的功能并发进行互不干扰,实现功能解耦,并且本发明中通过CRC校验来进行秘钥更新的验证,可以保障电能表真正的完成秘钥更新。本申请还提供一种秘钥更新装置、采集终端设备及计算机可读存储介质,具有上述有益效果。It can be seen that the present invention ensures that the functions of executing the key update are performed concurrently without interfering with each other by operating in the acquisition terminal, thereby realizing functional decoupling, and the key update is verified by CRC check in the present invention, which can ensure that the electric energy meter truly completes the key update. The present application also provides a key update device, an acquisition terminal device, and a computer-readable storage medium, which have the above-mentioned beneficial effects.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

图1为本发明实施例所提供的一种秘钥更新方法的实施流程图;FIG1 is a flowchart of an implementation method for updating a secret key provided by an embodiment of the present invention;

图2为本发明实施例所提供的一种秘钥更新方法的流程图;FIG2 is a flow chart of a key updating method provided by an embodiment of the present invention;

图3为本发明实施例所提供的数据发送的具体流程图;FIG3 is a specific flow chart of data transmission provided by an embodiment of the present invention;

图4为本发明实施例所提供的数据接收的具体流程图;FIG4 is a specific flow chart of data reception provided by an embodiment of the present invention;

图5为本发明实施例所提供的一种秘钥更新装置的结构框图;FIG5 is a structural block diagram of a key updating device provided by an embodiment of the present invention;

图6为本发明实施例所提供的一种采集终端设备的结构框图。FIG6 is a structural block diagram of a collection terminal device provided by an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

在电力行业采集系统中,存在系统主站、采集终端以及电能表三个部分。采集终端安装在变压器下,另有多个电能表安装在同一电力线上,一般是用电力载波通讯(载波模块是一个可插拔的模块,插在采集终端上)。并且采集终端属于中间媒介设备,其上连接系统主站,其下连接电能表。系统主站通过采集终端或者采集终端本身都可以对电能表进行参数读写、数据读取、控制等操作,其通讯以报文的形式存在,为了完全起见,报文往往是被加密的数据。In the power industry data collection system, there are three parts: the system master station, the data collection terminal, and the electric energy meter. The data collection terminal is installed under the transformer, and multiple electric energy meters are installed on the same power line. Generally, power carrier communication is used (the carrier module is a pluggable module that is plugged into the data collection terminal). And the data collection terminal is an intermediate media device, which is connected to the system master station on the top and the electric energy meter on the bottom. The system master station can read and write parameters, read data, and control the electric energy meter through the data collection terminal or the data collection terminal itself. Its communication exists in the form of messages. For the sake of completeness, the messages are often encrypted data.

欧洲市场对数据加密的功能非常看重,其他越来越多的市场也都慢慢增加了对数据加密的需求,数据的加密需要用到秘钥,可以是所有的电能表共用一个秘钥,也可以是每个表都是不同的秘钥,为了提高秘钥的使用安全性,可以随时更改秘钥。The European market attaches great importance to the data encryption function, and more and more other markets are also gradually increasing the demand for data encryption. Data encryption requires a secret key. All electricity meters can share one secret key, or each meter can have a different secret key. In order to improve the security of the use of the secret key, the secret key can be changed at any time.

目前现有两种更新秘钥的方法,一种为系统主站通过采集终端,将新秘钥设置到每一个电能表,电能表返回设置的结果,系统主站根据返回的结果,更新界面上的状态显示。当电能表没有返回时,系统主站重发,达到重发次数后,根据执行结果,更新界面上的状态显示。如果更新成功,则用新的秘钥通讯。该方法用系统主站直接对电能表进行秘钥更新,会导致一直占用系统主站的资源,主站上的其他功能会受到影响,比如在更新过程中要抄读采集终端的数据或者参数,则响应慢很多。而且通讯涉及系统主站、采集终端以及电能表三个层面,导致一个报文的通讯时间增长,整个系统响应迟缓。There are currently two methods for updating the secret key. One is that the system master station sets the new secret key to each electric energy meter through the collection terminal. The electric energy meter returns the result of the setting, and the system master station updates the status display on the interface according to the returned result. When the electric energy meter does not return, the system master station resends. After the number of resends is reached, the status display on the interface is updated according to the execution result. If the update is successful, the new secret key is used for communication. This method uses the system master station to directly update the secret key of the electric energy meter, which will cause the resources of the system master station to be occupied all the time, and other functions on the master station will be affected. For example, if the data or parameters of the collection terminal need to be read during the update process, the response will be much slower. Moreover, the communication involves three levels: the system master station, the collection terminal, and the electric energy meter, which increases the communication time of a message and slows down the response of the entire system.

另一种为系统主站把要更新的电能表信息及秘钥下发给采集终端,由采集终端执行秘钥更新任务,再上报结果给系统主站,系统主站进行界面的状态更新。但是,按目前各大厂家的采集终端来看,基本都是使用一个任务执行完所有的电能表秘钥更新功能。就目前市场上使用的高速载波通讯方案来说,没有体现并发,即同时可以发送多个采集终端抄读电能表的报文,比如同时可以发送15个报文的功能,整体通讯速度没有合理的利用。而且设置秘钥后,由于秘钥是只写模式(不支持读),所以并不能通过读取秘钥来确认是否设置成功。仅通过电能表返回确认,就认为是设置成功,并没有通过其他方式去再次确认,无法确定是否设置成功。The other is that the system master sends the energy meter information and secret key to be updated to the collection terminal, and the collection terminal executes the secret key update task, and then reports the result to the system master, and the system master updates the status of the interface. However, according to the current collection terminals of major manufacturers, basically all the energy meter secret key update functions are executed using one task. As for the high-speed carrier communication scheme currently used in the market, there is no concurrency, that is, multiple collection terminals can send messages to read the energy meter at the same time, such as the function of sending 15 messages at the same time, and the overall communication speed is not reasonably utilized. Moreover, after setting the secret key, since the secret key is in write-only mode (reading is not supported), it is not possible to confirm whether the setting is successful by reading the secret key. Only through the confirmation returned by the energy meter, it is considered that the setting is successful, and there is no other way to confirm again, and it is impossible to determine whether the setting is successful.

鉴于此,本发明提供了一种秘钥更新方法,通过在采集终端中操作,保证执行秘钥更新的功能并发进行互不干扰,实现功能解耦,并且本发明中通过CRC校验来进行秘钥更新的验证,可以保障电能表真正的完成秘钥更新。In view of this, the present invention provides a key update method, which ensures that the functions of executing the key update are performed concurrently without interfering with each other by operating in the acquisition terminal, thereby realizing functional decoupling. In addition, the key update is verified by CRC check in the present invention, which can ensure that the electric energy meter truly completes the key update.

为便于理解,首先将对秘钥更新的方法进行简单描述。请参考图1,图1为本发明实施例所提供的一种秘钥更新方法的实施流程图,方法包括:系统主站设置表档案参数和秘钥更新任务参数发送至采集终端;采集终端回复确认帧,系统主站接收到确认帧后,再读取参数进行比对,确认参数是否设置成功;采集终端根据参数执行秘钥更新,执行完成秘钥更新后,将事件上报给系统主站;系统主站判断后,显示在主站界面,并回复确认帧;采集终端接收到确认帧后不再重发,否则需要重发,直到主站回复确认帧为止;系统主站当接收到执行秘钥更新成功的事件,则启用新的秘钥。需要说明的是,数据帧通讯都带有帧序号,表示收发帧的一致性。For ease of understanding, the method for updating the secret key will first be briefly described. Please refer to Figure 1, which is an implementation flow chart of a secret key updating method provided by an embodiment of the present invention, and the method includes: the system master station sets the table file parameters and the secret key update task parameters and sends them to the acquisition terminal; the acquisition terminal replies with a confirmation frame, and after the system master station receives the confirmation frame, it reads the parameters for comparison to confirm whether the parameters are set successfully; the acquisition terminal executes the secret key update according to the parameters, and after the secret key update is completed, the event is reported to the system master station; after the system master station makes a judgment, it is displayed on the master station interface and replies with a confirmation frame; after receiving the confirmation frame, the acquisition terminal will no longer resend, otherwise it needs to resend until the master station replies with a confirmation frame; when the system master station receives the event of successful execution of the secret key update, the new secret key is enabled. It should be noted that data frame communications all carry frame sequence numbers, indicating the consistency of the sent and received frames.

下面进行详细介绍,请参考图2,图2为本发明实施例所提供的一种秘钥更新方法的流程图,本发明实施例一种秘钥更新方法,应用于采集终端可以包括:The following is a detailed description, please refer to FIG. 2, which is a flow chart of a key update method provided by an embodiment of the present invention. A key update method according to an embodiment of the present invention, applied to a collection terminal, may include:

步骤S101:接收秘钥更新任务参数和表档案信息。Step S101: receiving key update task parameters and table file information.

本发明实施例中表档案信息为电能表的档案信息,包括电能表的抄读端口号,表地址等电能表信息,可以根据档案信息实现与目标电能表通讯,其中,表地址为用于唯一标识电能表。In the embodiment of the present invention, the meter file information is the file information of the electric energy meter, including the reading port number of the electric energy meter, the meter address and other electric energy meter information, and communication with the target electric energy meter can be achieved based on the file information, wherein the meter address is used to uniquely identify the electric energy meter.

本发明实施例中秘钥更新任务参数可以包括表地址,秘钥的CRC16校验值等信息,需要说明的是,秘钥为一串HEX码的字符串,可以为16个字节,也可以为多个字节,本发明实施例对此不做限制。本发明实施例中可以对秘钥进行CRC16算法,得到两个字节HEX码的校验值,其中,CRC为循环冗余校验,为Cyclic Redundancy Che的简称,CRC16为CRC的一种校验算法。In the embodiment of the present invention, the key update task parameters may include table address, CRC16 check value of the key and other information. It should be noted that the key is a string of HEX code, which can be 16 bytes or multiple bytes, and the embodiment of the present invention does not limit this. In the embodiment of the present invention, the CRC16 algorithm can be performed on the key to obtain a check value of a two-byte HEX code, where CRC is a cyclic redundancy check, which is the abbreviation of Cyclic Redundancy Che, and CRC16 is a check algorithm of CRC.

本发明实施例中可以先接收系统主站下发的表档案信息,根据表档案信息中的表地址等信息实现与电能表通讯,再接收系统主站下发的秘钥更新任务参数,实现对电能表进行秘钥更新的操作。In the embodiment of the present invention, the table file information sent by the system master station can be received first, and communication with the electric energy meter can be achieved according to the table address and other information in the table file information, and then the key update task parameters sent by the system master station can be received to implement the key update operation of the electric energy meter.

步骤S102:根据秘钥更新任务参数和表档案信息,发送设置表秘钥的执行指令。Step S102: Sending an execution instruction for setting the table key according to the key update task parameters and the table file information.

本发明实施例中执行指令包含需要进行秘钥更新的电能表序号、执行步骤即设置表秘钥以及ID等信息,其中,ID与执行步骤相对应,ID为秘钥标签,秘钥标签是一个数据项,可以根据ID从数据库中读取秘钥内容。例如存在N个表档案信息序号,从0开始,表示第一次执行的是序号为0的电能表的秘钥更新,执行步骤为设置秘钥步骤,ID为ID1,需要说明的是,表档案信息序号由系统主站设置,用Nmax表示系统主站设置的表档案信息序号的总数,其中,N小于Nmax,Nman的数值一般小于1024。In the embodiment of the present invention, the execution instruction includes the serial number of the electric energy meter that needs to update the secret key, the execution step, i.e., setting the table secret key, and the ID and other information, wherein the ID corresponds to the execution step, and the ID is the secret key tag, which is a data item, and the secret key content can be read from the database according to the ID. For example, there are N table archive information serial numbers, starting from 0, indicating that the first execution is the secret key update of the electric energy meter with serial number 0, the execution step is the secret key setting step, and the ID is ID1. It should be noted that the table archive information serial number is set by the system master station, and Nmax is used to represent the total number of table archive information serial numbers set by the system master station, wherein N is less than Nmax, and the value of Nman is generally less than 1024.

本发明实施例中可以根据秘钥更新任务参数和表档案信息,通过对比秘钥更新任务参数和表档案信息是否相符的方式,确定进行秘钥更新的电能表并发送设置表秘钥的执行指令。需要说明的是,可以对比秘钥更新任务参数中的表地址和表档案信息中的表地址是否相符,也可以对比其他信息是否相符,本发明实施例对此不做限制。In the embodiment of the present invention, the electric energy meter to be updated with a secret key can be determined and an execution instruction for setting the table secret key can be sent by comparing the secret key update task parameters and the table file information to see whether they are consistent. It should be noted that the table address in the secret key update task parameters and the table address in the table file information can be compared to see whether they are consistent, or other information can be compared to see whether they are consistent, and the embodiment of the present invention does not limit this.

本发明实施例中可以优先检测策略执行临时区是否有操作指令,若有操作指令,则发送操作指令。当没有操作指令时,再检测策略执行队列是否执行数据,若有执行数据,则根据提取的执行数据,产生并发送操作指令,从策略执行队列中删除执行数据。当没有执行数据时,则利用策略提取器产生设置表秘钥的执行指令,并发送执行指令。需要说明的是,策略执行临时区用于存放通过策略执行队列产生的操作指令,且只能存放一条指令内容。策略执行队列用于存放返回的执行数据。其中,操作指令包含需要电能表序号、执行步骤即读取表秘钥的CRC以及ID等信息。执行数据为电能表返回的执行步骤和执行结果等信息。In the embodiment of the present invention, it is possible to preferentially detect whether there are operation instructions in the policy execution temporary area. If there are operation instructions, the operation instructions are sent. When there are no operation instructions, it is then detected whether the policy execution queue has execution data. If there are execution data, the operation instructions are generated and sent according to the extracted execution data, and the execution data is deleted from the policy execution queue. When there is no execution data, the policy extractor is used to generate an execution instruction for setting the table key, and the execution instruction is sent. It should be noted that the policy execution temporary area is used to store the operation instructions generated by the policy execution queue, and only one instruction content can be stored. The policy execution queue is used to store the returned execution data. Among them, the operation instruction contains information such as the required electric energy meter serial number, the execution step, i.e., the CRC of reading the table key, and the ID. The execution data is information such as the execution steps and execution results returned by the electric energy meter.

本发明实施例中可以在发送操作指令之后,检测是否发送成功,若发送成功,则将策略执行临时区清空,若发送不成功,则不清空策略执行临时区并等待预设时间后继续发送。其中,本发明实施例中对预设时间的数值不做限制,可以由设计人员预先设置例如设置为20秒,也可以根据具体使用场景进行设置。In the embodiment of the present invention, after sending the operation instruction, it can be detected whether the sending is successful. If the sending is successful, the policy execution temporary area is cleared. If the sending is unsuccessful, the policy execution temporary area is not cleared and the sending is continued after waiting for a preset time. In the embodiment of the present invention, there is no restriction on the value of the preset time, which can be preset by the designer, for example, to 20 seconds, or can be set according to the specific usage scenario.

本发明实施例中可以将执行指令和操作指令发送至抄读执行队列,需要说明的是,若发送操作指令时,抄读执行队列中的指令数量达到预设值,则将产生的一条操作指令存入策略执行临时区,等待预设时间后,检测策略执行临时区是否有数据。若发送执行指令时,抄读执行队列中的指令数量达到预设值,则等待预设时间后,退出策略提取器并检测策略执行临时区是否有数据,若未达到预设值,则将执行指令发送至抄读执行队列。例如从序号0,开始将报文一条一条发送至抄读执行队列,发送成功后,序号增加1,若抄读执行队列达到预设值,则序号不变,退出策略提取器并检测策略执行临时区是否有数据。其中,本发明实施例中对预设值的设置不做限制,可以由设计人员预先设置,也可以根据具体使用场景进行设置。本发明实施例中对预设时间的数值不做限制,可以由设计人员预先设置例如设置为20秒,也可以根据具体使用场景进行设置。In the embodiment of the present invention, the execution instruction and the operation instruction can be sent to the copy reading execution queue. It should be noted that if the number of instructions in the copy reading execution queue reaches the preset value when the operation instruction is sent, the generated operation instruction is stored in the policy execution temporary area, and after waiting for the preset time, the policy execution temporary area is detected to have data. If the number of instructions in the copy reading execution queue reaches the preset value when the execution instruction is sent, the policy extractor is exited after waiting for the preset time and the policy execution temporary area is detected to have data. If the preset value is not reached, the execution instruction is sent to the copy reading execution queue. For example, starting from sequence number 0, the message is sent to the copy reading execution queue one by one. After the sending is successful, the sequence number increases by 1. If the copy reading execution queue reaches the preset value, the sequence number remains unchanged, the policy extractor is exited and the policy execution temporary area is detected to have data. Among them, the setting of the preset value is not limited in the embodiment of the present invention, and can be preset by the designer, or it can be set according to the specific usage scenario. In the embodiment of the present invention, the value of the preset time is not limited, and can be preset by the designer, for example, it is set to 20 seconds, or it can be set according to the specific usage scenario.

本发明实施例中通过根据秘钥更新任务参数和表档案信息,发送设置表秘钥的执行指令的方式,实现更有效地执行设置表秘钥操作。In the embodiment of the present invention, by sending an execution instruction for setting the table key according to the key update task parameters and the table file information, a more efficient execution of the table key setting operation is achieved.

步骤S103:根据执行指令,设置表秘钥并接收返回的执行数据。Step S103: according to the execution instruction, set the table key and receive the returned execution data.

本发明实施例中执行数据包含执行步骤即设置表秘钥,执行结果等信息,其中,本发明实施例中执行结果可以为超时、成功以及失败。In the embodiment of the present invention, the execution data includes information such as the execution steps, i.e., setting the table key, the execution result, etc., wherein the execution result in the embodiment of the present invention can be timeout, success, and failure.

本发明实施例中可以根据执行指令中的ID信息,从数据库中读取相应的秘钥参数等信息,将秘钥参数等信息发送至载波模块,实现设置表秘钥,电能表完成设置表秘钥后将执行结果等信息返回至载波模块,通过载波模块再将信息返回至抄读模块,抄读模块对返回的信息进行解析产生执行数据,策略模块接收执行数据并将其存放在策略执行队列。In the embodiment of the present invention, the corresponding key parameters and other information can be read from the database according to the ID information in the execution instruction, and the key parameters and other information can be sent to the carrier module to set the table key. After the electric energy meter completes the setting of the table key, the execution result and other information are returned to the carrier module, and the information is returned to the reading module through the carrier module. The reading module parses the returned information to generate execution data, and the strategy module receives the execution data and stores it in the strategy execution queue.

本发明实施例中通过运用载波模块的并发特性,实现更有效对电能表进行设置秘钥的操作。In the embodiment of the present invention, the concurrent characteristics of the carrier module are utilized to achieve a more efficient operation of setting the secret key for the electric energy meter.

步骤S104:根据执行数据,发送读取表秘钥的CRC的操作指令。Step S104: according to the execution data, an operation instruction for reading the CRC of the table key is sent.

本发明实施例中操作指令包含电能表序号、执行步骤即读取表秘钥的CRC以及ID等信息。In the embodiment of the present invention, the operation instruction includes information such as the serial number of the electric energy meter, the execution step, i.e., reading the CRC of the meter key, and the ID.

本发明实施例中可以根据执行数据中的执行结果,发送读取表秘钥的CRC的操作指令。需要说明的是,本发明实施例中需要判断执行结果是否为超时,若执行结果为超时,则判断执行次数,若执行次数小于预设数值,则发送执行指令,若执行次数等于预设数值,则将失败事件上报系统主站。若执行结果不为超时即成功或失败时,则发送读取表秘钥的CRC的操作指令。其中,本发明实施例中对预设数值的大小不做限制,可以由设计人员预先设置,例如设置为三次,也可以根据具体使用场景进行设置。In an embodiment of the present invention, an operation instruction for reading the CRC of the table key can be sent according to the execution result in the execution data. It should be noted that in an embodiment of the present invention, it is necessary to determine whether the execution result is a timeout. If the execution result is a timeout, the number of executions is determined. If the number of executions is less than a preset value, an execution instruction is sent. If the number of executions is equal to the preset value, the failure event is reported to the system master station. If the execution result is not a timeout, that is, success or failure, an operation instruction for reading the CRC of the table key is sent. Among them, in an embodiment of the present invention, there is no restriction on the size of the preset value, which can be pre-set by the designer, for example, set to three times, or can be set according to the specific usage scenario.

本发明实施例中根据执行数据,通过执行步骤和执行结果,可以使其在执行功能时不相干扰,功能解耦,更有效地执行操作。In the embodiment of the present invention, according to the execution data, through the execution steps and the execution results, it is possible to prevent interference when executing functions, decouple functions, and perform operations more efficiently.

步骤S105:根据操作指令,读取表秘钥的CRC并接收返回的读取数据。Step S105: According to the operation instruction, read the CRC of the table key and receive the returned read data.

本发明实施例中读取数据包含执行步骤即读取表秘钥的CRC,执行结果等信息,其中,本发明实施例中执行结果可以为超时、成功以及失败。In the embodiment of the present invention, reading data includes executing steps, i.e. reading the CRC of the table key, executing results and other information, wherein the executing results in the embodiment of the present invention may be timeout, success and failure.

本发明实施例中可以根据操作指令,从数据库中读取相应的秘钥内容等信息,将信息发送至载波模块,实现读取表秘钥的CRC,读取电能表的表秘钥的CRC后将执行结果等信息返回至载波模块,通过载波模块再将信息返回至抄读模块,抄读模块对返回的信息进行解析产生读取数据,策略模块接收读取数据并将其存放在策略执行队列。In the embodiment of the present invention, according to the operation instruction, the corresponding key content and other information can be read from the database, and the information is sent to the carrier module to realize reading the CRC of the table key. After reading the CRC of the table key of the electric energy meter, the execution result and other information are returned to the carrier module, and the information is returned to the reading module through the carrier module. The reading module parses the returned information to generate read data, and the strategy module receives the read data and stores it in the strategy execution queue.

本发明实施例中通过运用载波模块的并发特性,实现更有效地进行读取电能表的表秘钥的CRC操作。In the embodiment of the present invention, by utilizing the concurrent characteristics of the carrier module, a more efficient CRC operation of reading the table key of the electric energy meter is achieved.

步骤S106:根据读取数据,进行CRC验证,完成秘钥更新。Step S106: Perform CRC verification based on the read data to complete the key update.

本发明实施例中可以根据读取数据中的执行结果,进行CRC验证,完成秘钥更新。需要说明的是,本发明实施例中需要判断执行结果是否为超时,若执行结果为超时,则判断执行次数,若执行次数小于预设数值,则发送操作指令,若执行次数等于预设数值,则将失败事件上报系统主站。若执行结果为成功时,则进行CRC验证,完成秘钥更新。若执行结果为失败时,则将失败事件上报系统主站。其中,本发明实施例中对预设数值的大小不做限制,可以由设计人员预先设置,例如设置为三次,也可以根据具体使用场景进行设置。需要说明的是,本发明实施例中CRC验证的方式,可以为对比读取的表秘钥的CRC值和数据库中秘钥的CRC值是否相符,若相符,则将结果发送至系统主站,完成秘钥更新。In the embodiment of the present invention, CRC verification can be performed according to the execution result in the read data to complete the key update. It should be noted that in the embodiment of the present invention, it is necessary to determine whether the execution result is a timeout. If the execution result is a timeout, the number of executions is determined. If the number of executions is less than the preset value, the operation instruction is sent. If the number of executions is equal to the preset value, the failure event is reported to the system master station. If the execution result is successful, CRC verification is performed to complete the key update. If the execution result is a failure, the failure event is reported to the system master station. Among them, in the embodiment of the present invention, there is no restriction on the size of the preset value, which can be pre-set by the designer, for example, set to three times, or set according to the specific usage scenario. It should be noted that the method of CRC verification in the embodiment of the present invention can be to compare the CRC value of the table key read and the CRC value of the key in the database to see if they match. If they match, the result is sent to the system master station to complete the key update.

本发明实施例中由于电能表的秘钥是只写模式,不能读取秘钥进行比对来判断最终结果,如果使用设置秘钥后的电能表回复来判断,安全性不高,本发明实施例中通过进行CRC验证判断最终结果的方式,可以准确的确定电能表是否真正的已更新,能快速有效的对整个秘钥更新功能形成闭环。In the embodiment of the present invention, since the secret key of the electric energy meter is in write-only mode, the secret key cannot be read for comparison to determine the final result. If the electric energy meter reply after setting the secret key is used for judgment, the security is not high. In the embodiment of the present invention, by performing CRC verification to determine the final result, it is possible to accurately determine whether the electric energy meter has been truly updated, and to quickly and effectively form a closed loop for the entire secret key update function.

基于上述实施例,本发明实施例通过在采集终端中操作,保证执行秘钥更新的功能并发进行互不干扰,实现功能解耦,并且本发明实施例中通过CRC校验来进行秘钥更新的验证,可以保障电能表真正的完成秘钥更新。Based on the above embodiments, the embodiments of the present invention ensure that the functions of executing key updates are performed concurrently without interfering with each other by operating in the acquisition terminal, thereby achieving functional decoupling. In addition, the embodiment of the present invention verifies the key update through CRC check, which can ensure that the electric energy meter truly completes the key update.

下面通过具体例子说明上述过程,本发明实施例选取linux平台的采集终端对DLMS协议电能表,高安全级别访问控制秘钥,在本采集终端中,有两个功能模块分别为策略模块和抄读模块可以为线程或进程,在本发明实施例中为两个进程,相当在linux系统中运行的两个独立APP。策略模块为主动方,抄读模块为被动方,电能表为目标设备,设置表秘钥步骤为step1,设置表秘钥的ID为id1;读取表秘钥的CRC步骤为step2,读取表秘钥的CRC的ID为id2。The above process is explained below through a specific example. In the embodiment of the present invention, the acquisition terminal of the Linux platform is selected to access the DLMS protocol electric energy meter with a high security level access control key. In this acquisition terminal, there are two functional modules, namely the policy module and the reading module, which can be threads or processes. In the embodiment of the present invention, there are two processes, which are equivalent to two independent APPs running in the Linux system. The policy module is the active party, the reading module is the passive party, and the electric energy meter is the target device. The step of setting the table key is step1, and the ID of setting the table key is id1; the step of reading the CRC of the table key is step2, and the ID of reading the CRC of the table key is id2.

请参考图3,图3为本发明实施例所提供的数据发送的具体流程图,过程具体如下:Please refer to FIG. 3 , which is a specific flow chart of data transmission provided by an embodiment of the present invention. The specific process is as follows:

策略模块的具体数据发送流程如下:The specific data sending process of the strategy module is as follows:

1、检测策略临时执行区是否有数据,如果有,则组报文发送给抄读模块。1. Check whether there is data in the temporary execution area of the strategy. If so, the group message is sent to the reading module.

2、当策略临时执行区没有数据时,则检查策略执行队列是否有数据,如果有数据,从策略执行队列中提取并删除此数据,策略模块判断执行步骤和执行结果。2. When there is no data in the temporary policy execution area, check whether there is data in the policy execution queue. If there is data, extract and delete the data from the policy execution queue, and the policy module determines the execution steps and results.

3、若执行步骤为step1,则判断执行结果。若执行结果为超时,判断执行次数,若执行次数少于3次,则不改变步骤step1和id1,组报文形成执行指令发送给抄读模块。若执行次数等于三次时,产生失败事件上报系统主站。当执行结果为成功或失败时,修改step1为step2,id为id2,组报文形成操作指令发送给抄读模块。3. If the execution step is step1, determine the execution result. If the execution result is timeout, determine the number of executions. If the number of executions is less than 3 times, do not change step1 and id1, and send the group message to the reading module to form an execution instruction. If the number of executions is equal to three times, generate a failure event and report it to the system master station. When the execution result is success or failure, modify step1 to step2, id to id2, and send the group message to the reading module to form an operation instruction.

4、若执行步骤为step2,则判断执行结果。若执行结果为超时,判断执行次数,若执行次数少于3次,则不改变步骤step2和id2,组报文形成操作指令发送给抄读模块。若执行次数等于三次时,产生失败事件上报系统主站。当执行结果为成功时,策略模块比对CRC值,当一致时产生成功事件,上报系统主站。当执行结果为失败时,则产生失败事件上报系统主站。4. If the execution step is step2, determine the execution result. If the execution result is timeout, determine the number of executions. If the number of executions is less than 3 times, do not change step 2 and id2, and form a group message to send the operation instruction to the reading module. If the number of executions is equal to three times, a failure event is generated and reported to the system master station. When the execution result is successful, the strategy module compares the CRC value. When they are consistent, a success event is generated and reported to the system master station. When the execution result is a failure, a failure event is generated and reported to the system master station.

5、当策略执行队列没有数据,则从策略提取器中产生数据,N为表档案的序号,从0开始,表示第一次执行的是序号为0的电能表的秘钥更新,修改步骤为step1,id为id1,组报文形成执行指令发送至抄读模块。Nmax为主站设置的表档案总数,一般小于1024。5. When there is no data in the strategy execution queue, data is generated from the strategy extractor. N is the serial number of the table file, starting from 0, indicating that the first execution is the key update of the electric energy meter with serial number 0. The modification step is step1, and the id is id1. The group message forms an execution instruction and is sent to the reading module. Nmax is the total number of table files set by the master station, which is generally less than 1024.

抄读模块的具体数据发送流程如下:The specific data sending process of the reading module is as follows:

检测抄读执行队列中是否有数据,若有数据,则提取后并删除此数据,组报文发送给载波模块,继而发送给电能表进行设置表秘钥或读取表秘钥的CRC的操作。Check whether there is data in the reading execution queue. If there is data, extract and delete the data, send the group message to the carrier module, and then send it to the electric energy meter to set the meter key or read the CRC of the meter key.

请参考图4,图4为本发明实施例所提供的数据接收的具体流程图,过程具体如下:Please refer to FIG. 4, which is a specific flow chart of data receiving provided by an embodiment of the present invention. The specific process is as follows:

策略模块的具体数据接收流程如下:The specific data receiving process of the strategy module is as follows:

1、策略执行临时区产生数据发送后,若抄读执行队列回复队列已满,则不做任何处理,等待20秒后继续发送,否则发送并删除策略执行临时区中的数据,程序从当前功能退出。1. After the data generated in the strategy execution temporary area is sent, if the copy execution queue replies that the queue is full, no processing will be done and it will continue to send after waiting for 20 seconds. Otherwise, the data in the strategy execution temporary area will be sent and deleted, and the program will exit from the current function.

2、从策略执行队列产生数据发送后,若抄读执行队列回复队列已满,则把数据存入策略执行临时区,等待20秒后,程序从当前功能退出,检测策略执行临时区是否有数据,否则不把数据存入执行临时区,程序从当前功能退出。2. After the data is generated and sent from the strategy execution queue, if the copy execution queue replies that the queue is full, the data is stored in the strategy execution temporary area. After waiting for 20 seconds, the program exits from the current function and checks whether there is data in the strategy execution temporary area. Otherwise, the data is not stored in the execution temporary area and the program exits from the current function.

3、从策略提取器产生的数据发送后,若抄读执行队列回复队列已满,则序号不变,等待20秒后,程序从当前功能退出,检测策略执行临时区是否有数据,否则序号+1,程序从当前功能退出。3. After the data generated by the policy extractor is sent, if the copy execution queue replies that the queue is full, the sequence number remains unchanged. After waiting for 20 seconds, the program exits from the current function and checks whether there is data in the policy execution temporary area. Otherwise, the sequence number is increased by 1 and the program exits from the current function.

抄读模块的具体数据接收流程如下:The specific data receiving process of the reading module is as follows:

接收到电能表的回复后,判断报文的有效性,并根据DLMS协议的报文解析,得到执行结果为失败或成功,比如一段时间超时后还是没有接收到电能表的回复,则执行结果为超时,将产生的执行数据或读取数据发送给策略执行队列。After receiving the reply from the energy meter, the validity of the message is determined, and the execution result is obtained as failure or success based on the message parsing of the DLMS protocol. For example, if no reply is received from the energy meter after a period of timeout, the execution result is timeout, and the generated execution data or read data is sent to the strategy execution queue.

本发明实施例中运用两个功能模块的异步执行操作,保证执行秘钥更新的功能并发进行互不干扰,实现功能解耦,通过执行步骤和执行结果,最后采用读取CRC校验来进行秘钥更新的验证,能快读有效的对整个秘钥更新功能形成闭环,保障电能表真正的完成秘钥更新。In the embodiment of the present invention, the asynchronous execution operation of two functional modules is used to ensure that the functions of executing the key update are performed concurrently without interfering with each other, thereby realizing functional decoupling. By executing the steps and the execution results, the CRC check is finally read to verify the key update, which can quickly and effectively form a closed loop for the entire key update function, thereby ensuring that the electric energy meter truly completes the key update.

下面对本发明实施例所提供的一种秘钥更新装置以及采集终端设备进行介绍,下文描述的秘钥更新装置以及采集终端设备与上文描述的秘钥更新方法可相互对应参照。A key updating device and a collection terminal device provided in an embodiment of the present invention are introduced below. The key updating device and the collection terminal device described below can correspond to the key updating method described above.

请参考图5,图5为本发明实施例所提供的一种秘钥更新装置的结构框图,该装置可以包括:Please refer to FIG. 5 , which is a structural block diagram of a key updating device provided by an embodiment of the present invention. The device may include:

接收模块201,用于接收秘钥更新任务参数和表档案信息;The receiving module 201 is used to receive the key update task parameters and table file information;

第一发送模块202,用于根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令;A first sending module 202, configured to send an execution instruction for setting a table key according to the key update task parameters and the table file information;

设置秘钥模块203,用于根据所述执行指令,设置所述表秘钥并接收返回的执行数据;A key setting module 203, used to set the table key according to the execution instruction and receive the returned execution data;

第二发送模块204,用于根据所述执行数据,发送读取所述表秘钥的CRC的操作指令;A second sending module 204 is used to send an operation instruction to read the CRC of the table key according to the execution data;

读取秘钥模块205,用于根据所述操作指令,读取所述表秘钥的所述CRC并接收返回的读取数据;A key reading module 205 is used to read the CRC of the table key and receive returned read data according to the operation instruction;

验证模块206,用于根据所述读取数据,进行CRC验证,完成所述秘钥更新。The verification module 206 is used to perform CRC verification based on the read data to complete the key update.

基于上述实施例,所述接收模块201,可以包括:Based on the above embodiment, the receiving module 201 may include:

判断单元,用于对比所述秘钥更新任务参数与所述表档案信息是否相符;A judgment unit, used to compare whether the key update task parameters are consistent with the table file information;

发送单元,用于若相符,则确定进行秘钥更新的电能表并发送设置所述表秘钥的所述执行指令。The sending unit is used to determine the electric energy meter to be updated with the secret key and send the execution instruction for setting the table secret key if it matches.

基于上述任意实施例,所述第一发送模块202,可以包括:Based on any of the foregoing embodiments, the first sending module 202 may include:

第一检测单元,用于检测策略执行临时区是否有所述操作指令;若有所述操作指令,则发送所述操作指令;A first detection unit is used to detect whether the policy execution temporary area has the operation instruction; if the operation instruction is present, the operation instruction is sent;

第二检测单元,用于若没有所述操作指令,则检测策略执行队列是否所述执行数据;若有所述执行数据,则根据提取的所述执行数据,产生并发送所述操作指令;A second detection unit is used to detect whether the policy execution queue contains the execution data if there is no operation instruction; if there is the execution data, generate and send the operation instruction according to the extracted execution data;

本发明实施例中若抄读执行队列中的指令数量达到预设值,则将产生的一条所述操作指令存入所述策略执行临时区。In the embodiment of the present invention, if the number of instructions in the copy-read execution queue reaches a preset value, a generated operation instruction is stored in the strategy execution temporary area.

提取单元,用于若没有所述执行数据,则利用策略提取器产生设置所述表秘钥的所述执行指令,并发送所述执行指令。The extraction unit is used for generating the execution instruction for setting the table key by using the policy extractor if the execution data is not available, and sending the execution instruction.

基于上述任意实施例,所述第一检测单元之后,还可以包括:Based on any of the above embodiments, after the first detection unit, the following may further be included:

判断单元,用于检测是否发送成功;若发送成功,则将所述策略执行临时区清空;A judgment unit, used to detect whether the sending is successful; if the sending is successful, the policy execution temporary area is cleared;

等待发送单元,用于若发送不成功,则不清空所述策略执行临时区并等待预设时间后继续发送。The waiting and sending unit is used for not clearing the policy execution temporary area and waiting for a preset time to continue sending if the sending is unsuccessful.

基于上述任意实施例,所述第二发送模块204,可以包括:Based on any of the foregoing embodiments, the second sending module 204 may include:

结果判断单元,用于判断执行结果是否为超时;A result judgment unit, used to judge whether the execution result is a timeout;

执行判断单元,用于若所述执行结果为超时,则判断执行次数;An execution judgment unit, configured to judge the number of executions if the execution result is a timeout;

发送单元,用于若所述执行次数小于预设数值,则发送所述执行指令;若所述执行次数等于所述预设数值,则将失败事件上报系统主站;A sending unit, configured to send the execution instruction if the execution number is less than a preset value; and report a failure event to a system master station if the execution number is equal to the preset value;

执行单元,用于若所述执行结果不为超时,则发送读取所述表秘钥的所述CRC的所述操作指令。An execution unit is configured to send the operation instruction of reading the CRC of the table key if the execution result is not a timeout.

基于上述任意实施例,所述验证模块206,可以包括:Based on any of the above embodiments, the verification module 206 may include:

执行单元,用于若执行结果为成功,则进行所述CRC验证,完成所述秘钥更新;An execution unit, configured to perform the CRC verification and complete the key update if the execution result is successful;

上报单元,用于若所述执行结果为失败,则将失败事件上报所述系统主站。The reporting unit is used to report the failure event to the system main station if the execution result is a failure.

结果判断单元,用于判断所述执行结果是否为超时;A result judgment unit, used to judge whether the execution result is a timeout;

执行判断单元,用于若所述执行结果为超时,则判断执行次数;An execution judgment unit, configured to judge the number of executions if the execution result is a timeout;

发送单元,用于若所述执行次数小于预设数值,则发送所述操作指令;若所述执行次数等于所述预设数值,则将失败事件上报所述系统主站。The sending unit is used to send the operation instruction if the execution times are less than the preset value; if the execution times are equal to the preset value, report the failure event to the system main station.

基于上述任意实施例,所述执行单元,可以包括:Based on any of the above embodiments, the execution unit may include:

判断子单元,用于对比所述表秘钥的所述CRC值和数据库中秘钥的CRC值是否相符;A judgment subunit, used to compare the CRC value of the table key with the CRC value of the key in the database to see if they match;

执行子单元,用于若相符,则将结果发送至所述系统主站,完成所述秘钥更新。The execution subunit is used to send the result to the system main station if it matches, so as to complete the key update.

本发明实施例中通过在采集终端中操作,保证执行秘钥更新的功能并发进行互不干扰,实现功能解耦,以及本发明实施例中通过CRC校验来进行秘钥更新的验证,可以保障电能表真正的完成秘钥更新。In the embodiment of the present invention, by operating in the acquisition terminal, it is ensured that the functions of executing the key update are performed concurrently without interfering with each other, thereby realizing functional decoupling, and in the embodiment of the present invention, the key update is verified by CRC check, which can ensure that the electric energy meter truly completes the key update.

请参考图6,图6为本发明实施例所提供的一种采集终端设备的结构框图,该采集终端设备包括:Please refer to FIG. 6, which is a structural block diagram of a collection terminal device provided by an embodiment of the present invention. The collection terminal device includes:

存储器10,用于存储计算机程序;A memory 10, used for storing computer programs;

处理器20,用于执行所述计算机程序时,以实现上述的秘钥更新方法。The processor 20 is used to implement the above-mentioned key updating method when executing the computer program.

如图6所示,为采集终端设备的结构示意图,可以包括:存储器10、处理器20、通信接口31、输入输出接口32以及通信总线33。As shown in FIG6 , it is a schematic diagram of the structure of the acquisition terminal device, which may include: a memory 10 , a processor 20 , a communication interface 31 , an input/output interface 32 , and a communication bus 33 .

在本发明实施例中,存储器10中用于存放一个或者一个以上程序,程序可以包括程序代码,程序代码包括计算机操作指令,在本申请实施例中,存储器10中可以存储有用于实现以下功能的程序:In the embodiment of the present invention, the memory 10 is used to store one or more programs, and the program may include program code, and the program code includes computer operation instructions. In the embodiment of the present application, the memory 10 may store programs for implementing the following functions:

接收秘钥更新任务参数和表档案信息;Receive key update task parameters and table file information;

根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令;Sending an execution instruction for setting a table key according to the key update task parameters and the table archive information;

根据所述执行指令,设置所述表秘钥并接收返回的执行数据;According to the execution instruction, setting the table key and receiving returned execution data;

根据所述执行数据,发送读取所述表秘钥的CRC的操作指令;According to the execution data, sending an operation instruction for reading the CRC of the table key;

根据所述操作指令,读取所述表秘钥的所述CRC并接收返回的读取数据;According to the operation instruction, read the CRC of the table key and receive the returned read data;

根据所述读取数据,进行CRC验证,完成所述秘钥更新。According to the read data, CRC verification is performed to complete the key update.

在一种可能的实现方式中,存储器10可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统,以及至少一个功能所需的应用程序等;存储数据区可存储使用过程中所创建的数据。In a possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.

此外,存储器10可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器的一部分还可以包括NVRAM。存储器存储有操作系统和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。操作系统可以包括各种系统程序,用于实现各种基础任务以及处理基于硬件的任务。In addition, the memory 10 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include an NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and processing hardware-based tasks.

处理器20可以为中央处理器(Central Processing Unit,CPU)、特定应用集成电路、数字信号处理器、现场可编程门阵列或者其他可编程逻辑器件,处理器20可以是微处理器或者也可以是任何常规的处理器等。处理器20可以调用存储器10中存储的程序。The processor 20 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic device, a microprocessor or any conventional processor, etc. The processor 20 may call a program stored in the memory 10.

通信接口31可以为用于与其他设备或者系统连接的接口。The communication interface 31 may be an interface for connecting to other devices or systems.

输入输出接口32可以为用于获取外界输入数据或向外界输出数据的接口。The input/output interface 32 may be an interface for acquiring external input data or outputting data to the outside world.

当然,需要说明的是,图6所示的结构并不构成对本申请实施例中采集终端设备的限定,在实际应用中采集终端设备可以包括比图6所示的更多或更少的部件,或者组合某些部件。Of course, it should be noted that the structure shown in FIG. 6 does not constitute a limitation on the acquisition terminal device in the embodiment of the present application. In actual applications, the acquisition terminal device may include more or fewer components than those shown in FIG. 6 , or combine certain components.

本发明实施例中通过在采集终端中操作,保证执行秘钥更新的功能并发进行互不干扰,实现功能解耦,并且通过CRC校验来进行秘钥更新的验证,可以保障电能表真正的完成秘钥更新。In the embodiment of the present invention, by operating in the acquisition terminal, it is ensured that the functions of executing the key update are performed concurrently without interfering with each other, thereby realizing functional decoupling, and the key update is verified by CRC check, thereby ensuring that the electric energy meter truly completes the key update.

本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机可执行指令,计算机可执行指令被处理器加载并执行时,实现接收秘钥更新任务参数和表档案信息;根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令;根据所述执行指令,设置所述表秘钥并接收返回的执行数据;根据所述执行数据,发送读取所述表秘钥的CRC的操作指令;根据所述操作指令,读取所述表秘钥的所述CRC并接收返回的读取数据;根据所述读取数据,进行CRC验证,完成所述秘钥更新。本发明实施例中通过在采集终端中操作,保证执行秘钥更新的功能并发进行互不干扰,实现功能解耦,并且通过CRC校验来进行秘钥更新的验证,可以保障电能表真正的完成秘钥更新。The embodiment of the present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by the processor, the receiving of key update task parameters and table file information is realized; according to the key update task parameters and the table file information, an execution instruction for setting the table key is sent; according to the execution instruction, the table key is set and the returned execution data is received; according to the execution data, an operation instruction for reading the CRC of the table key is sent; according to the operation instruction, the CRC of the table key is read and the returned read data is received; according to the read data, CRC verification is performed to complete the key update. In the embodiment of the present invention, by operating in the acquisition terminal, it is ensured that the functions of executing the key update are performed concurrently without interfering with each other, functional decoupling is achieved, and the key update is verified by CRC verification, which can ensure that the electric energy meter truly completes the key update.

说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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 the present invention.

结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

以上对本发明所提供的一种秘钥更新方法、装置、采集终端设备以及存储介质进行了详细介绍。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The above is a detailed introduction to a key update method, device, acquisition terminal equipment and storage medium provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims (9)

1.一种秘钥更新的方法,其特征在于,应用于采集终端,包括:1. A method for updating a secret key, characterized in that it is applied to a collection terminal and comprises: 接收秘钥更新任务参数和表档案信息;Receive key update task parameters and table file information; 根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令;Sending an execution instruction for setting a table key according to the key update task parameters and the table archive information; 其中,所述发送设置表秘钥的执行指令,包括:检测策略执行临时区是否有所述表秘钥的CRC的操作指令;若有所述操作指令,则发送所述操作指令;若没有所述操作指令,则检测策略执行队列是否有返回的执行数据;若有所述执行数据,则根据提取的所述执行数据,产生并发送所述操作指令;若没有所述执行数据,则利用策略提取器产生设置所述表秘钥的所述执行指令,并发送所述执行指令;Wherein, the sending of the execution instruction for setting the table key comprises: detecting whether the policy execution temporary area has an operation instruction of the CRC of the table key; if the operation instruction is present, sending the operation instruction; if the operation instruction is not present, detecting whether the policy execution queue has returned execution data; if the execution data is present, generating and sending the operation instruction according to the extracted execution data; if the execution data is not present, generating the execution instruction for setting the table key by using the policy extractor, and sending the execution instruction; 根据所述执行指令,设置所述表秘钥并接收所述执行数据;According to the execution instruction, setting the table key and receiving the execution data; 根据所述执行数据,发送读取所述操作指令;Send and read the operation instruction according to the execution data; 根据所述操作指令,读取所述表秘钥的所述CRC并接收返回的读取数据;According to the operation instruction, read the CRC of the table key and receive the returned read data; 根据所述读取数据,进行CRC验证,完成所述秘钥更新。According to the read data, CRC verification is performed to complete the key update. 2.如权利要求1所述的一种秘钥更新的方法,其特征在于,所述若有所述操作指令,则发送所述操作指令之后,还包括:2. A method for updating a secret key according to claim 1, characterized in that if the operation instruction is present, after sending the operation instruction, the method further comprises: 检测是否发送成功;Check whether the sending is successful; 若发送成功,则将所述策略执行临时区清空;If the sending is successful, the policy execution temporary area is cleared; 若发送不成功,则不清空所述策略执行临时区并等待预设时间后继续发送。If the sending is unsuccessful, the policy execution temporary area will not be cleared and the sending will continue after waiting for a preset time. 3.如权利要求1所述的一种秘钥更新的方法,其特征在于,所述根据提取的所述执行数据,产生并发送所述操作指令之后,包括:3. A method for updating a secret key according to claim 1, characterized in that after generating and sending the operation instruction according to the extracted execution data, the method further comprises: 若抄读执行队列中的指令数量达到预设值,则将产生的一条所述操作指令存入所述策略执行临时区。If the number of instructions in the copy execution queue reaches a preset value, a generated operation instruction is stored in the strategy execution temporary area. 4.如权利要求1所述的一种秘钥更新的方法,其特征在于,所述根据所述执行数据,发送读取所述操作指令,包括:4. The method for updating a secret key according to claim 1, wherein sending and reading the operation instruction according to the execution data comprises: 判断执行结果是否为超时;Determine whether the execution result is timeout; 若所述执行结果为超时,则判断执行次数;If the execution result is a timeout, determining the number of executions; 若所述执行次数小于预设数值,则发送所述执行指令;If the execution times are less than a preset value, sending the execution instruction; 若所述执行次数等于所述预设数值,则将失败事件上报系统主站;If the execution times are equal to the preset value, the failure event is reported to the system master station; 若所述执行结果不为超时,则发送读取所述表秘钥的所述CRC的所述操作指令。If the execution result is not a timeout, sending the operation instruction for reading the CRC of the table key. 5.如权利要求1所述的一种秘钥更新的方法,其特征在于,所述根据所述读取数据,进行CRC验证,完成所述秘钥更新,包括:5. A method for updating a secret key according to claim 1, characterized in that the step of performing CRC verification according to the read data to complete the key update comprises: 若执行结果为成功,则进行所述CRC验证,完成所述秘钥更新;If the execution result is successful, the CRC verification is performed to complete the key update; 若所述执行结果为失败,则将失败事件上报系统主站;If the execution result is failure, the failure event is reported to the system master station; 判断所述执行结果是否为超时;Determine whether the execution result is a timeout; 若所述执行结果为超时,则判断执行次数;If the execution result is a timeout, determining the number of executions; 若所述执行次数小于预设数值,则发送所述操作指令;If the execution times are less than a preset value, sending the operation instruction; 若所述执行次数等于所述预设数值,则将失败事件上报系统主站。If the execution times are equal to the preset value, the failure event is reported to the system main station. 6.如权利要求1所述的一种秘钥更新的方法,其特征在于,所述根据所述读取数据,进行CRC验证,完成所述秘钥更新,包括:6. A method for updating a secret key according to claim 1, characterized in that the step of performing CRC verification according to the read data to complete the secret key update comprises: 对比所述表秘钥的CRC值和数据库中秘钥的CRC值是否相符;Compare the CRC value of the table key with the CRC value of the key in the database to see if they match; 若相符,则将结果发送至系统主站,完成所述秘钥更新。If they match, the result is sent to the system master station to complete the key update. 7.如权利要求1所述的一种秘钥更新的方法,其特征在于,所述根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令,包括:7. A method for updating a key according to claim 1, characterized in that the step of sending an execution instruction for setting a table key according to the key update task parameter and the table file information comprises: 对比所述秘钥更新任务参数与所述表档案信息是否相符;Comparing the key update task parameters with the table file information to see if they are consistent; 若相符,则确定进行秘钥更新的电能表并发送设置所述表秘钥的所述执行指令。If they match, the electric energy meter for which the secret key is to be updated is determined and the execution instruction for setting the table secret key is sent. 8.一种秘钥更新装置,其特征在于,包括:8. A key updating device, comprising: 接收模块,用于接收秘钥更新任务参数和表档案信息;A receiving module, used to receive key update task parameters and table file information; 第一发送模块,用于根据所述秘钥更新任务参数和所述表档案信息,发送设置表秘钥的执行指令;A first sending module, used for sending an execution instruction for setting a table secret key according to the secret key update task parameters and the table archive information; 其中,所述第一发送模块包括:第一检测单元,用于检测策略执行临时区是否有所述表秘钥的CRC的操作指令;若有所述操作指令,则发送所述操作指令;第二检测单元,用于若没有所述操作指令,则检测策略执行队列是否有返回的执行数据;若有所述执行数据,则根据提取的所述执行数据,产生并发送所述操作指令;提取单元,用于若没有所述执行数据,则利用策略提取器产生设置所述表秘钥的所述执行指令,并发送所述执行指令;The first sending module includes: a first detection unit, used to detect whether the policy execution temporary area has an operation instruction of the CRC of the table secret key; if the operation instruction is present, the operation instruction is sent; a second detection unit, used to detect whether the policy execution queue has returned execution data if there is no operation instruction; if the execution data is present, the operation instruction is generated and sent according to the extracted execution data; an extraction unit, used to generate the execution instruction for setting the table secret key by using the policy extractor if there is no execution data, and send the execution instruction; 设置秘钥模块,用于根据所述执行指令,设置所述执行数据;A key setting module is used to set the execution data according to the execution instruction; 第二发送模块,用于根据所述执行数据,发送读取所述操作指令;A second sending module, used for sending and reading the operation instruction according to the execution data; 读取秘钥模块,用于根据所述操作指令,读取所述表秘钥的所述CRC并接收返回的读取数据;A key reading module, used for reading the CRC of the table key and receiving returned read data according to the operation instruction; 验证模块,用于根据所述读取数据,进行CRC验证,完成所述秘钥更新。The verification module is used to perform CRC verification based on the read data to complete the key update. 9.一种采集终端设备,其特征在于,包括:9. A data collection terminal device, characterized by comprising: 存储器,用于存储计算机程序;Memory for storing computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述的秘钥更新方法。A processor, configured to implement the key updating method according to any one of claims 1 to 7 when executing the computer program.
CN202211191113.5A 2022-09-28 2022-09-28 A key updating method, device, acquisition terminal device and storage medium Active CN115603901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211191113.5A CN115603901B (en) 2022-09-28 2022-09-28 A key updating method, device, acquisition terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211191113.5A CN115603901B (en) 2022-09-28 2022-09-28 A key updating method, device, acquisition terminal device and storage medium

Publications (2)

Publication Number Publication Date
CN115603901A CN115603901A (en) 2023-01-13
CN115603901B true CN115603901B (en) 2024-08-09

Family

ID=84844786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211191113.5A Active CN115603901B (en) 2022-09-28 2022-09-28 A key updating method, device, acquisition terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN115603901B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101488854A (en) * 2008-01-18 2009-07-22 华为技术有限公司 Wireless RFID system authentication method and apparatus
CN108259174A (en) * 2018-04-23 2018-07-06 唯得智慧(湖北)科技有限公司 The update method of safety door unblocking key based on narrowband Internet of Things

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101488854A (en) * 2008-01-18 2009-07-22 华为技术有限公司 Wireless RFID system authentication method and apparatus
CN108259174A (en) * 2018-04-23 2018-07-06 唯得智慧(湖北)科技有限公司 The update method of safety door unblocking key based on narrowband Internet of Things

Also Published As

Publication number Publication date
CN115603901A (en) 2023-01-13

Similar Documents

Publication Publication Date Title
CN112286565B (en) Embedded system differential upgrading method based on storage container
CN110597839A (en) Transaction data processing method, device, equipment and storage medium
CN110995825B (en) Intelligent contract issuing method, intelligent node equipment and storage medium
CN111111214B (en) Game archiving processing method, device and system
CN113407444B (en) Interface test case generation method, device, equipment and storage medium
CN110769411A (en) Method, device, equipment and system for stably realizing batch OTA (over the air) upgrade of terminal equipment
CN112100081B (en) Upgrade test method and device based on double-core intelligent electric meter and computer equipment
CN110659905A (en) Transaction verification method, device, terminal equipment and storage medium
CN110555079A (en) Data processing method, device, equipment and storage medium
CN115603901B (en) A key updating method, device, acquisition terminal device and storage medium
CN113313594B (en) Order processing method, order processing device, electronic equipment, storage medium and program product
CN109800565B (en) Software upgrading method and terminal equipment
CN111324645A (en) Data processing method and device for block chain
CN112579141A (en) Firmware updating method, device, equipment and storage medium of embedded system
CN118642738A (en) A safety controller upgrade method and system
CN117519753A (en) Remote upgrading method, device and equipment of terminal equipment and storage medium
CN117058813A (en) Parameter configuration method for electric energy meter
CN116560706A (en) Differential upgrading method and device for electric energy meter and server
CN118394395A (en) A controller upgrade method, vehicle, device and medium
CN114003566B (en) Resource acquisition method, resource acquisition device, storage medium and electronic equipment
CN116909599A (en) Method, device, equipment and storage medium for upgrading engine offline software
CN113452735A (en) Narrow-band transmission method and equipment based on block chain
CN114285916B (en) Method and device for generating delay injection data based on framing identification
CN112286464B (en) Method, device, storage medium and terminal for checking data integrity by on-chip CRC
CN108304167A (en) A kind of raising interface calls stability approach and device

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
TR01 Transfer of patent right

Effective date of registration: 20250813

Address after: 1418 Moganshan Road, Hangzhou, Zhejiang 310000 (Shangcheng Industrial Park)

Patentee after: HANGZHOU HEXING ELECTRICAL Co.,Ltd.

Country or region after: China

Address before: 310011 No. 1418-35, Building 1, Room 301, Mogan Mountain Road, Hangzhou City, Zhejiang Province (Shangcheng Science and Technology Industrial Base)

Patentee before: Hangzhou Renhe Information Technology Co.,Ltd.

Country or region before: China