Data writing method, electronic equipment and computer readable storage medium

By detecting and parsing the data file to be parsed in the processor, inserting fixed value data and updating the verification code, the problem of data mismatch after remote upgrade of the secondary device is solved, and a simplified remote upgrade process and high automation and intelligence level is achieved. Improvement.

CN118981323AActive Publication Date: 2024-11-19CYG SUNRI CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410898411.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-11-19
Estimated Expiration
2044-07-05

AI Technical Summary

Technical Problem

In traditional technology, after the secondary equipment is remotely upgraded, the fixed value data does not match the solidified data in the non-volatile memory, resulting in abnormal self-test alarms, which requires operation and maintenance personnel to eliminate them on site, and the level of automation and intelligence is not high, which consumes a lot of money. Time and manpower.

Method used

Provide a data writing method, detects the data file to be parsed through the processor, parses and inserts the fixed value data into the volatile memory, calculates and updates the verification code to avoid writing fixed value data in the non-volatile memory. Change stored data to ensure data consistency, simplify remote upgrade processes, and improve automation and intelligence levels.

Benefits of technology

It effectively avoids the self-test alarm abnormality after remote upgrade of secondary equipment, saves the time and manpower spent on remote upgrades, and improves the automation and intelligence level of secondary equipment operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981323A_ABST
    Figure CN118981323A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, in particular to a data writing method, electronic equipment and a computer readable storage medium. The method is applied to a processor, the processor is configured in a control device, and the method comprises the steps that if it is detected that a to-be-analyzed data file exists, the to-be-analyzed data file is analyzed, an analyzed data file is obtained, and the analyzed data file comprises fixed value data, insertion section positioning information of the fixed value data and a fixed value data check code of the fixed value data; reading stored data in the first memory, and temporarily storing the stored data to a first address field in the second memory; according to the insertion section positioning information, inserting the constant value data into the first address section; calculating a second check code according to the constant value data check code and the stored data, and modifying the first check code in the second memory into the second check code; and reading the stored data and the constant value data in the second memory and writing the stored data and the constant value data into the first memory. The automation level and the intelligence level of remote upgrading can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a data writing method, an electronic device, and a computer-readable storage medium. Background Art

[0002] The power system is a complex system consisting of primary and secondary equipment. The primary equipment is used to provide power to the power system, and the secondary equipment is used to control, protect, measure and monitor the power system. In order to ensure the safe and stable operation of the power system, operation and maintenance personnel need to operate and maintain the secondary equipment.

[0003] In traditional technical solutions, some operation processes for the operation and maintenance of secondary equipment need to be completed on-site by the operation and maintenance personnel. For example, when remotely upgrading secondary equipment such as relay protection devices, since fixed value data is added to the upgraded relay protection device, the newly added fixed value data does not match the data solidified in the non-volatile memory of the relay protection device, which will cause the relay protection device to generate an alarm abnormality after self-test. This alarm abnormality requires on-site operation by the operation and maintenance personnel to eliminate it. On-site operation by the operation and maintenance personnel not only requires complex safety measures and processes, but also manual data verification requires a lot of time and manpower. The automation and intelligence levels of the traditional technical solutions for the operation and maintenance of secondary equipment are not high. Summary of the invention

[0004] The embodiments of the present application provide a data writing method, an electronic device, and a computer-readable storage medium, which can save time and manpower consumed in remote upgrading of a control device, simplify the remote upgrading process of the control device, and improve the automation and intelligence level of the remote upgrading of the control device.

[0005] In a first aspect, an embodiment of the present application provides a data writing method, which is applied to a processor, and the processor is configured in a control device. The method includes: if it is detected that there is a data file to be parsed, the data file to be parsed is parsed to obtain a parsed data file, the parsed data file includes fixed value data, insertion segment positioning information of the fixed value data and a fixed value data check code of the fixed value data; reading the stored data in the first memory, and temporarily storing the stored data in the first address segment of the second memory, the stored data includes a first check code, the first check code is used to verify the stored data, the stored data is data required for the normal operation of the control device, the first memory is a non-volatile memory, and the second memory is a volatile memory; according to the insertion segment positioning information, the fixed value data is inserted into the first address segment of the second memory; according to the fixed value data check code and the stored data, a second check code is calculated, and the first check code in the second memory is modified to a second check code, and the second check code is used to verify the stored data and the fixed value data; reading the stored data and the fixed value data in the second memory, and writing the stored data and the fixed value data into the first memory.

[0006] In some embodiments, the parsed data file also includes an insertion segment step, the insertion segment positioning information includes at least one insertion segment sub-positioning information, the constant value data includes at least one constant value sub-data, the insertion segment step is used to characterize the bit address interval between any two insertion segment sub-positioning information, and at least one insertion segment sub-positioning information corresponds one-to-one to at least one constant value sub-data; according to the insertion segment positioning information, the constant value data is inserted into the first address segment in the second memory, including: according to at least one insertion segment sub-positioning information and the insertion segment step, at least one insertion address of at least one constant value sub-data in the second memory is calculated, at least one constant value sub-data corresponds one-to-one to at least one insertion address, and at least one insertion address is an address in the first address segment; the first constant value sub-data is inserted into the first insertion address in the second memory, the first constant value sub-data is data in at least one fixed value sub-data, and the first insertion address is an address in at least one insertion address corresponding to the first fixed value sub-data.

[0007] In some embodiments, the processor is a management processor, and before parsing the data file to be parsed, it also includes: receiving a remote operation and maintenance upgrade package; verifying the remote operation and maintenance upgrade package to obtain a verification result, and the verification result is used to characterize whether the remote operation and maintenance upgrade package carries the data file to be parsed; if the verification result indicates that the remote operation and maintenance upgrade package carries the data file to be parsed, then sending the data file to be parsed to at least one non-management processor.

[0008] In some embodiments, the verification result is also used to characterize whether the remote operation and maintenance upgrade package carries at least one first update application package, and whether the remote operation and maintenance upgrade package carries a second update application package, at least one first update application corresponds one-to-one to at least one non-management processor, at least one non-management processor is used to run at least one first update application package, and the management processor is used to run the second update application package; if the verification result indicates that the remote operation and maintenance upgrade package carries a data file to be parsed, the data file to be parsed is sent to at least one non-management processor, including: if the verification result indicates that the remote operation and maintenance upgrade package carries a data file to be parsed, at least one first update application package and a second update application package, the data file to be parsed is sent to at least one non-management processor, and the corresponding first update application package is sent to the first non-management processor, and the first non-management processor is any one of the at least one non-management processors.

[0009] In some embodiments, after sending the corresponding first update application package to the first non-management processor, it also includes: installing a second update application based on the second update application package; if installation completion information is received from each non-management processor in at least one non-management processor, executing a whole machine reset instruction, the whole machine reset instruction is used to restart the control device, and the installation completion information is used to indicate that the corresponding first update application has been installed.

[0010] In some embodiments, if it is detected that there is a data file to be parsed, the data file to be parsed is parsed to obtain a parsed data file, including: in response to a received power-on signal, detecting whether there is a data file to be parsed, the power-on signal is used to indicate that the control device has been restarted; if it is detected that there is a data file to be parsed, the data file to be parsed is parsed to obtain a parsed data file.

[0011] In some implementations, after reading the stored data and the fixed value data in the second memory and writing the stored data and the fixed value data into the first memory, the method further includes: deleting the parsed data file.

[0012] In some implementations, the file format of the data file to be parsed is a binary format.

[0013] In a second aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement a method as described in any one of the above-mentioned first aspects.

[0014] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method as described in any one of the first aspects above.

[0015] In the technical solution provided by the embodiment of the present application, the processor can parse the data file to be parsed after detecting the data file to be parsed to obtain the parsed data file. And temporarily store the stored data in the non-volatile memory in the volatile memory. Then, according to the insertion segment positioning information in the parsed data file, insert the fixed value data in the parsed data file into the volatile memory; and calculate the second check code according to the fixed value data and the stored data, and update the second check code to the volatile memory. Finally, rewrite the stored data and the fixed value data in the non-volatile memory. It can avoid the situation where the stored data in the non-volatile memory is changed when the fixed value data is written in the non-volatile memory. The second check code contains the data information corresponding to the fixed value data and the stored data, which can avoid the control device from generating abnormal alarms when performing board verification or board verification, thereby realizing the remote upgrade of the control device, saving the time and manpower consumed in the remote upgrade of the control device, simplifying the remote upgrade process of the control device, and improving the automation level and intelligence level of the remote upgrade of the control device. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 It is a schematic diagram of an application scenario of a data writing method provided in an embodiment of the present application.

[0018] Figure 2 It is a flow chart of a data writing method provided in an embodiment of the present application.

[0019] Figure 3 This is another flowchart of a data writing method provided in an embodiment of the present application.

[0020] Figure 4 It is a schematic diagram of a non-volatile memory of a data writing method provided in an embodiment of the present application.

[0021] Figure 5 It is a schematic diagram of a volatile memory of a data writing method provided in an embodiment of the present application.

[0022] Figure 6 It is a schematic diagram of a data writing device provided in an embodiment of the present application.

[0023] Figure 7 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0025] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0026] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0027] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when what" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0028] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0029] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0030] In the power system, secondary equipment can control, protect, measure and monitor the power system to ensure the safe and stable operation of the power system. Secondary equipment can include relay protection devices, automatic power generation adjustment devices, excitation control devices, load control devices, telemetry and remote control devices, data acquisition devices, monitoring systems, communication equipment, etc. In order to ensure the safe and stable operation of the power system, operation and maintenance personnel need to operate and maintain secondary equipment.

[0031] In traditional technical solutions, when operation and maintenance personnel need to remotely upgrade secondary equipment, the secondary equipment may generate a self-test alarm exception because the device APP (Application) of the upgraded secondary equipment does not match the data solidified in the non-volatile memory of the secondary equipment. This self-test alarm exception needs to be eliminated on-site by operation and maintenance personnel. On-site operations by operation and maintenance personnel not only require complex safety measures and processes, but also manual data verification requires a lot of time and manpower. The automation and intelligence levels of traditional technical solutions for secondary equipment operation and maintenance are not high.

[0032] In view of this, an embodiment of the present application provides a data writing method, which can avoid self-test alarm anomalies after the secondary device is remotely upgraded, and improve the automation and intelligence level of the secondary device operation and maintenance.

[0033] The technical solution of the embodiments of the present application is exemplarily described below with reference to the accompanying drawings.

[0034] like Figure 1 As shown, it is a schematic diagram of an application scenario of a data writing method provided by an embodiment of the present application. Figure 1, multiple processors correspond to multiple non-volatile memories (a first non-volatile memory, a second non-volatile memory, a third non-volatile memory, and a fourth non-volatile memory). Multiple processors are respectively connected to corresponding non-volatile memories, and can read instructions and data from corresponding non-volatile memories, and perform operations and processing on the data. Multiple processors are respectively connected to volatile memories, and are used to read data in non-volatile memories and temporarily store them in volatile memories. Multiple processors include MCPU (Management CPU), PCPU (Protection CPU), BCPU (Blocking CPU) and SCOM (Communication Module). Among them, MCPU is a management motherboard with an operating system, which is used to manage and coordinate the information of each sub-board, display the device interface to the outside and interact with external communications. PCPU refers to the core protection CPU in the relay protection device, which is a sub-board without an operating system and can complete the execution of the relay protection logic segment. BCPU is the core locking CPU in the relay protection device. It is a sub-board without an operating system. It is a double set of redundancy of PCPU and is used to complete the execution of the relay protection logic segment. SCOM is a sub-board without an operating system. It is used for high-speed real-time bus communication between sub-boards inside the device and to exchange the core data of the relay protection device.

[0035] The data writing method provided in the embodiment of the present application can be applied to a processor, and the processor is configured in a control device. The control device can be a secondary device in the power system, for example, a relay protection device, an automatic power generation adjustment device, an excitation control device, a load control device, a telemetry and remote control device, a data acquisition device, a monitoring system, a communication device, etc. This application takes a relay protection device as an example to illustrate the data writing method provided in the embodiment. It can be understood that the data writing method provided in the embodiment of the present application can also be used for other devices that need to write data.

[0036] In the embodiment of the present application, the operation and maintenance personnel can first determine the functions required by the relay protection device or the set values ​​that need to be modified by analyzing the actual situation of the substation in the power system. The corresponding software development is carried out to generate a remote operation and maintenance upgrade package to ensure the correctness and reliability of the software function. The remote operation and maintenance upgrade package is transmitted to the relay protection device through the power grid dispatching master station to realize the remote upgrade of the relay protection device without manual on-site intervention.

[0037] Combine the following Figures 2 to 5 The method flow in the figure provides an exemplary description of the data writing method provided in the embodiment of the present application.

[0038] like Figure 2FIG. 1 is a flow chart of a data writing method provided in an embodiment of the present application. After receiving the remote operation and maintenance upgrade package sent by the power grid dispatching master station, the relay protection device performs the following steps:

[0039] Step S201: receiving a remote operation and maintenance upgrade package.

[0040] In the embodiment of the present application, the power grid dispatching master station can send the remote operation and maintenance upgrade package to the management processor of the relay protection device, and the management processor can be a mainboard with an operating system. For example, the management processor can be an MCPU.

[0041] The remote operation and maintenance upgrade package may include a data file to be parsed and multiple update application packages. The data file to be parsed may include the fixed value data required for the remote upgrade of the relay protection device. The fixed value data may be the setting parameters required for the protection action of the relay protection device, including but not limited to the action value, time setting value, specific curve and logical relationship data. The action value may be the action threshold of the relay protection device, for example, the action current value of the overcurrent relay. The time setting value may be the action delay time of the relay protection device, for example, the delay time of the overcurrent relay. The specific curve may be a mathematical expression of the action characteristics of the relay protection device, for example, the inverse time characteristic curve of the overcurrent relay. The logical relationship data may be the logical relationship data of the action of the relay protection device, for example, the interlocking relationship data between multiple relays.

[0042] In the embodiment of the present application, the file format of the data file to be parsed can be in binary format. Since the binary file format can save storage capacity, when the processor receives the data file to be parsed, it can reduce the occupation of the processor memory by the data file to be parsed, thereby saving storage resources and extending the use time of the hardware.

[0043] The number of multiple update application packages can be consistent with the number of processors in the relay protection device. For example, when the relay protection device includes four processors (one main board and three slave boards), the remote operation and maintenance upgrade package includes four update application packages. The four update application packages correspond to four processors respectively, and are used to perform remote operation and maintenance upgrades on the relay protection device.

[0044] Step S202: verify the remote operation and maintenance upgrade package to obtain a verification result, where the verification result is used to indicate whether the remote operation and maintenance upgrade package carries a data file to be parsed and at least one updated application package.

[0045] In an embodiment of the present application, at least one update application package may be an update application package corresponding to a management processor in a relay protection device, or a management processor (a mainboard processor with an operating system) and a non-management processor (a sub-board processor without an operating system). It is understandable that when the relay protection device includes only one management processor, the remote operation and maintenance upgrade package may only carry one update application package. When the relay protection device includes a management processor and at least one non-management processor, the remote operation and maintenance upgrade package may carry at least one first update application package and a second update application package. At least one first update application corresponds one-to-one to at least one non-management processor, and at least one non-management processor is used to run at least one first update application package, and the management processor is used to run the second update application package.

[0046] Step S203: If the verification result indicates that the remote operation and maintenance upgrade package carries a data file to be parsed, at least one first updated application package and a second updated application package, the data file to be parsed is sent to at least one non-management processor, and the corresponding first updated application package is sent to the first non-management processor, and the first non-management processor is any one of the at least one non-management processors.

[0047] In the embodiment of the present application, after receiving the remote operation and maintenance upgrade package, the management processor can perform integrity check on the data in the remote operation and maintenance upgrade package to ensure that the remote operation and maintenance upgrade package contains at least the data file to be parsed. If the remote operation and maintenance upgrade package does not contain the data file to be parsed, the management processor will no longer execute the subsequent data writing method flow.

[0048] The management processor may copy the data file to be parsed to a working directory to facilitate running the data file to be parsed, and send the data file to be parsed to a working directory corresponding to at least one non-management processor to facilitate each non-management processor to run the data file to be parsed.

[0049] Step S204: installing the second updated application based on the second updated application package.

[0050] In the embodiment of the present application, after the management processor sends the corresponding update application package to one or more non-management processors, the management processor installs the second update application according to the preset installation process, and monitors the installation result of each non-management processor installing the corresponding first update application package.

[0051] After receiving the first update application package sent by the management processor, the one or more non-management processors install the first update application according to a preset installation process.

[0052] Step S205: If installation completion information is received from each of the at least one non-management processors, a whole machine reset instruction is executed, where the whole machine reset instruction is used to restart the control device, and the installation completion information is used to indicate that the corresponding first update application has been installed.

[0053] In the embodiment of the present application, when installing the second update application, the management processor can monitor and receive the installation completion information sent by each non-management processor. If the installation completion information sent by each non-management processor is received and the second update application has been installed, the whole machine reset instruction is executed to restart the relay protection device.

[0054] The management processor restarts the relay protection device, which can make the code in each processor re-run, that is, restore the device to the initial state, so as to write the fixed value data in the data file to be parsed. After the management processor restarts the relay protection device, if each processor (including the management processor and the non-management processor) determines that the current relay protection device has been powered on, it detects whether there is a data file to be parsed in the working directory.

[0055] In an embodiment of the present application, each processor in the relay protection device can determine that the current relay protection device has been powered on by one or more methods such as a power management circuit, a reset circuit, a watchdog circuit, an external signal, and an internal clock. For the method learned through the power management circuit, the power management circuit of the relay protection device can send a power-on signal to each processor when the relay protection device is started or powered on, and the power-on signal is used to indicate that the relay protection device has been restarted. The power-on signal can be an interrupt signal, and the interrupt signal is used to trigger each processor to execute the corresponding startup code. For the method learned through the watchdog circuit, the reset circuit of the relay protection device can reset each processor to a known state when the relay protection device is started or powered on, so that each processor executes a predefined startup code. For the method learned through the watchdog circuit, the watchdog circuit of the relay protection device will periodically send a signal to each processor. If each processor does not respond to the sent signal within a preset time, it will trigger the reset circuit to reset the instructions of each processor, which can prevent each processor from falling into an infinite loop or failing to operate normally when starting or powering on. For the method of obtaining information by external signals, the relay protection device can notify each processor that the current device has been started or powered on through external signals, for example, by triggering the startup process through some buttons or switches. For the method of obtaining information by internal clocks, the relay protection device can use internal clocks to start each processor at a fixed time. The embodiment of the present application does not limit the method by which each processor in the relay protection device obtains information that the current relay protection device has been powered on.

[0056] In the embodiment of the present application, if the processor determines that the current relay protection device is powered on, it detects whether there is a data file to be parsed in the working directory. The corresponding data in the data file to be parsed is written into the non-volatile memory to realize the remote automatic upgrade processing of the relay protection device. On the basis of no need for manual on-site operation, the self-test alarm abnormality after the remote upgrade of the secondary equipment is avoided, and the automation and intelligence level of the secondary equipment operation and maintenance is improved.

[0057] like Figure 3 As shown, another flow chart of a data writing method provided by an embodiment of the present application is shown. If the processor (including the management processor and the non-management processor) detects that there is a data file to be parsed in the working directory, the data is written through the following steps:

[0058] Step S301: if it is detected that there is a data file to be parsed, the data file to be parsed is parsed to obtain a parsed data file, the parsed data file includes fixed value data, insertion segment positioning information of the fixed value data and a fixed value data check code of the fixed value data.

[0059] In an embodiment of the present application, if a processor (including a management processor and a non-management processor) detects that there is a data file to be parsed in a working directory, the data file to be parsed is parsed to obtain a parsed data file. In an embodiment of the present application, the parsed data file may include fixed value data, insertion segment positioning information of the fixed value data, and a fixed value data check code of the fixed value data. Optionally, the parsed data file may also include an insertion segment step length, and the insertion segment step length is used to characterize the bit address interval between any two insertion segment positioning information.

[0060] The insertion segment positioning information may include one or more insertion segment sub-positioning information, the fixed value data may include one or more fixed value sub-data, and the insertion segment sub-positioning information corresponds to the fixed value sub-data one by one. The insertion segment positioning information may be used to characterize the insertion position of one or more fixed value sub-data in the non-volatile memory, and the insertion segment step length may be used to characterize the distance between two insertion positions.

[0061] For example, Figure 4 As shown, a schematic diagram of a non-volatile memory of a data writing method provided in an embodiment of the present application is shown. It includes four non-volatile memories (a first non-volatile memory, a second non-volatile memory, a third non-volatile memory and a fourth non-volatile memory), and the four non-volatile memories are respectively connected to the MCPU, PCPU, BCPU and SCOM through an internal bus. Figure 4 As shown, the insertion segment positioning information of the fixed value data is used to represent the positions shown by multiple "insertion segment" arrows in the non-volatile memory. The insertion segment step length is used to represent the bit address interval between any two "insertion segment" arrows.

[0062] For example, for the constant value data contained in the parsed data file, if the voltage of the line protection device is 220kV, the field device is currently operating in the constant value area information 01, the constant value code is 100 (that is, the index, that is, the serial number of the constant value data is 100), the positive code value is 0x000000AA, and the reverse code value is 0xFFFFFF55, the content of the constant value data can be: 00007D805501011F03E802D07CC028600064000000AAFFFFFF55, and the reverse code value is used to verify the read result.

[0063] Step S302: read the stored data in the first memory, and temporarily store the stored data in the first address segment in the second memory, the stored data includes a first verification code, the first verification code is used to verify the stored data, the stored data is data required for the normal operation of the control device, the first memory is a non-volatile memory, and the second memory is a volatile memory.

[0064] For example, see Figure 1 The volatile memory may be a memory, and multiple processors may be connected to the memory respectively and temporarily store data through the memory.

[0065] In an embodiment of the present application, in order to avoid changing the data (stored data) solidified in the non-volatile memory during the process of writing the fixed value data, the processor can first temporarily store the data solidified in the non-volatile memory to the internal memory (second memory). The data solidified in the non-volatile memory of the relay protection device may include: device parameters, fixed value data, protection logic, event records and self-test data. The non-volatile memory is used to ensure that the solidified data will not be lost even after the device is powered off, so as to ensure the normal operation and maintenance of the relay protection device.

[0066] For example, see Figure 4 The stored data may be the data in each rectangular box of the first non-volatile memory, the second non-volatile memory, the third non-volatile memory and the fourth non-volatile memory, including: Set_Sys (system constant), Set (protection constant) (including multiple protection constant areas of the first non-volatile memory corresponding to the MCPU), Parameter (device parameter), SoftSet (soft pressure plate), TrigCfg (output configuration), TLVPara (TLV parameter), SetCrc (constant crc), ParameterCrc (device parameter crc), SoftSetCrc (soft pressure plate crc), TrigCfgCrc (output configuration crc), TLVParaCrc (TLV parameter crc) and Others (other settings).

[0067] In the embodiment of the present application, after the processor reads the stored data in the first memory and temporarily stores the stored data in the second memory, the data arrangement order of the stored data in the second memory is the same as that in the first memory.

[0068] For example, Figure 5 As shown in FIG. 1 , a schematic diagram of a volatile memory of a data writing method provided in an embodiment of the present application is shown. Figure 5 As shown in (a) in the figure, the processor will Figure 4 After the stored data in the first non-volatile memory is temporarily stored in the first address segment in the second memory, the data arrangement order of the stored data in the second memory is the same as that in the first non-volatile memory.

[0069] Step S303: inserting the fixed value data into the first address segment in the second memory according to the insertion segment positioning information.

[0070] In the embodiment of the present application, the processor can calculate at least one insertion address of at least one fixed value sub-data in the second memory according to at least one insertion segment sub-location information and the insertion segment step length, at least one fixed value sub-data corresponds to at least one insertion address, and at least one insertion address is an address in the first address segment. And insert the first fixed value sub-data into the first insertion address in the second memory, the first fixed value sub-data is data in at least one fixed value sub-data, and the first insertion address is an address in at least one insertion address corresponding to the first fixed value sub-data.

[0071] Since the processor directly writes the fixed value data into the memory, the data fixed in the memory (stored data) will be changed. In the technical solution provided in the embodiment of the present application, when the processor inserts the first fixed value sub-data into the first insertion address of the second memory, the fixed value sub-data can be inserted by copying the data. For example, see Figure 5 In (b), after determining the first insertion address among the multiple insertion addresses, the processor may first copy the data before the first insertion address in the stored data to the free bit address in the second memory, and then insert the first fixed value sub-data into the position where the first insertion address is located. Figure 5 In (c), the processor may copy the data after the first insertion address and before the second insertion address to the second memory, and then insert the second fixed value sub-data into the position where the second insertion address is located... until all the fixed value sub-data are inserted. Figure 5 In (d), the fixed value sub-data and the stored data are alternately stored in the second memory.

[0072] Step S304: Calculate a second check code according to the fixed value data check code and the stored data, and modify the first check code in the second memory into the second check code, where the second check code is used to verify the stored data and the fixed value data.

[0073] In the embodiment of the present application, in order to ensure the correctness and reliability during operation, the relay protection device can perform local board verification and inter-board verification after the remote upgrade process. If the data in the update verification code is consistent with the data in the relay protection device firmware (including non-volatile memory), the relay protection device can determine that the data in the firmware has not been illegally tampered with or damaged. If the data in the update verification code is inconsistent with the data in the relay protection device firmware, the relay protection device can determine that there may be a problem with the data in the firmware. The relay protection device will generate an abnormal alarm. The processor of the relay protection device calculates the update verification code through the fixed value data verification code and the stored data, which can ensure that the update verification code is consistent with the data in the relay protection device firmware, avoiding abnormal alarms in the relay protection device. Thereby ensuring the normal operation of the relay protection device.

[0074] For example, see Figure 5 In (a), after the processor calculates the second check code from the fixed value data check code and the stored data, it can modify the first check code of the bit address indicated by the "modify" arrow in the second memory to the second check code.

[0075] Step S305: Read the stored data and the fixed value data in the second memory, and write the stored data and the fixed value data into the first memory.

[0076] After the processor modifies the first check code in the second memory into the second check code, it can rewrite the stored data and the fixed value data temporarily stored in the second memory into the first memory to ensure the normal operation of the relay protection device. Figure 5 As shown, the stored data and the fixed value data in the second memory are alternately stored in the second memory. After the stored data and the fixed value data in the second memory are rewritten into the first memory, the arrangement order of the stored data and the fixed value data in the first memory is the same as that in the second memory.

[0077] In an embodiment of the present application, after the processor rewrites the stored data and constant data alternately stored in the second memory into the first memory, it can delete the parsed data file to avoid the relay protection device repeatedly updating and reading the parsed data file, thereby causing a control device operation failure.

[0078] In the technical solution provided by the embodiment of the present application, the processor can parse the data file to be parsed after detecting the data file to be parsed to obtain the parsed data file. And temporarily store the stored data in the non-volatile memory in the volatile memory. Then, according to the insertion segment positioning information in the parsed data file, insert the fixed value data in the parsed data file into the volatile memory; and calculate the second check code according to the fixed value data and the stored data, and update the second check code to the volatile memory. Finally, rewrite the stored data and the fixed value data in the non-volatile memory. It can avoid the situation where the stored data in the non-volatile memory is changed when the fixed value data is written in the non-volatile memory. The second check code contains the data information corresponding to the fixed value data and the stored data, which can avoid the control device from generating abnormal alarms when performing board verification or board verification, thereby realizing the remote upgrade of the control device, saving the time and manpower consumed in the remote upgrade of the control device, simplifying the remote upgrade process of the control device, and improving the automation level and intelligence level of the remote upgrade of the control device.

[0079] It should be understood that, under the premise of no logical conflict, the above-mentioned various application embodiments can be implemented in combination with each other to meet actual application requirements. The specific embodiments or implementation plans obtained after these combinations still fall within the protection scope of this application.

[0080] Corresponding to the data writing method in the above embodiment, an embodiment of the present application provides a data writing device 60. The data writing device 60 can be implemented by software, hardware or a combination of both to become part or all of a computer device, and is used to execute the steps in the data writing method in the above embodiment.

[0081] Figure 6 A schematic structural diagram of a data writing device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0082] Reference Figure 6 The data writing device 60 includes a parsing module 610 , a reading module 620 , a first writing module 630 , an updating module 640 and a second writing module 650 .

[0083] The parsing module 610 is used to parse the data file to be parsed when detecting the existence of the data file to be parsed, and obtain the parsed data file, wherein the parsed data file includes the fixed value data, the insertion segment positioning information of the fixed value data and the fixed value data check code of the fixed value data;

[0084] The reading module 620 is used to read the stored data in the first memory and temporarily store the stored data in the first address segment of the second memory, the stored data includes a first check code, the first check code is used to verify the stored data, the stored data is data required for the normal operation of the control device, the first memory is a non-volatile memory, and the second memory is a volatile memory;

[0085] A first writing module 630, used for inserting the fixed value data into the first address segment in the second memory according to the insertion segment positioning information;

[0086] An updating module 640 is used to calculate a second check code according to the fixed value data check code and the stored data, and to modify the first check code in the second memory to the second check code, wherein the second check code is used to verify the stored data and the fixed value data;

[0087] The second writing module 650 is used to read the stored data and the fixed value data in the second memory, and write the stored data and the fixed value data into the first memory.

[0088] In some embodiments, the parsed data file also includes an insertion segment step, the insertion segment positioning information includes at least one insertion segment sub-positioning information, the constant value data includes at least one constant value sub-data, the insertion segment step is used to characterize the bit address interval between any two insertion segment sub-positioning information, and at least one insertion segment sub-positioning information corresponds one-to-one to at least one constant value sub-data; the first writing module 630 is also used to: calculate at least one insertion address of at least one constant value sub-data in the second memory according to at least one insertion segment sub-positioning information and the insertion segment step, at least one fixed value sub-data corresponds one-to-one to at least one insertion address, and at least one insertion address is an address in the first address segment; insert the first fixed value sub-data into the first insertion address in the second memory, the first fixed value sub-data is data in at least one fixed value sub-data, and the first insertion address is an address in at least one insertion address corresponding to the first fixed value sub-data.

[0089] In some embodiments, the processor is a management processor, and the parsing module 610 is also used to: receive a remote operation and maintenance upgrade package; verify the remote operation and maintenance upgrade package to obtain a verification result, and the verification result is used to characterize whether the remote operation and maintenance upgrade package carries a data file to be parsed; if the verification result indicates that the remote operation and maintenance upgrade package carries a data file to be parsed, then the data file to be parsed is sent to at least one non-management processor.

[0090] In some embodiments, the verification result is also used to characterize whether the remote operation and maintenance upgrade package carries at least one first update application package, and whether the remote operation and maintenance upgrade package carries a second update application package, at least one first update application corresponds one-to-one to at least one non-management processor, at least one non-management processor is used to run at least one first update application package, and the management processor is used to run the second update application package; the parsing module 610 is also used to: if the verification result indicates that the remote operation and maintenance upgrade package carries a data file to be parsed, at least one first update application package and a second update application package, then the data file to be parsed is sent to at least one non-management processor, and the corresponding first update application package is sent to the first non-management processor, and the first non-management processor is any one of the at least one non-management processors.

[0091] In some embodiments, the parsing module 610 is also used to: install a second update application based on the second update application package; if installation completion information is received from each non-management processor in at least one non-management processor, execute a whole-machine reset instruction, the whole-machine reset instruction is used to restart the control device, and the installation completion information is used to indicate that the corresponding first update application has been installed.

[0092] In some embodiments, the parsing module 610 is also used to: detect whether there is a data file to be parsed in response to a received power-on signal, and the power-on signal is used to indicate that the control device has been restarted; if it is detected that there is a data file to be parsed, parse the data file to be parsed to obtain a parsed data file.

[0093] In some implementations, the second writing module 650 is further used to: delete the parsed data file.

[0094] In some implementations, the file format of the data file to be parsed is a binary format.

[0095] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0096] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0097] Based on the same inventive concept, an embodiment of the present application also provides an electronic device.

[0098] Figure 7 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 7 As shown, the electronic device 70 of this embodiment includes: at least one processor 710 ( Figure 7 Only one is shown in the figure), memory 720, and communication module 740, memory 720 stores computer program 730 that may be run on processor 710. When processor 710 executes computer program 730, steps in the above data writing method embodiment are implemented, such as Figure 3 Alternatively, when the processor 710 executes the computer program 730, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 5 The functions of the modules 610 to 650 are shown, and the communication module 740 can be a separate communication unit for communicating with an external server or terminal device.

[0099] The electronic device 70 may include, but is not limited to: a processor 710 and a memory 720. Those skilled in the art will appreciate that Figure 7 It is only an example of the electronic device 70 and does not constitute a limitation of the electronic device 70. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 70 may also include an input sending device, a network access device, a bus, etc.

[0100] The processor 710 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0101] In some embodiments, the memory 720 may be an internal storage unit of the electronic device 70, such as a hard disk or memory of the electronic device 70. The memory 720 may also be an external storage device of the electronic device 70, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 70. The memory 720 may also include both an internal storage unit of the electronic device 70 and an external storage device. The memory 720 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program 730. The memory 720 may also be used to temporarily store data that has been sent or is to be sent.

[0102] In addition, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0103] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on an electronic device, the electronic device executes the steps in the above-mentioned method embodiments.

[0104] An embodiment of the present application provides a chip, which includes a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, the steps in the above-mentioned method embodiments are implemented.

[0105] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the steps in the above-mentioned method embodiments.

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

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

[0108] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0109] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

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

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

[0113] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to a large-screen device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0115] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data writing method, characterized in that: The method is applied to a processor, and the processor is configured in a control device. The method includes: If it is detected that there is a data file to be parsed, the data file to be parsed is parsed to obtain a parsed data file, wherein the parsed data file includes fixed value data, insertion segment positioning information of the fixed value data, and a fixed value data check code of the fixed value data; Reading stored data in a first memory, and temporarily storing the stored data in a first address segment in a second memory, wherein the stored data includes a first check code, and the first check code is used to verify the stored data, and the stored data is data required for the normal operation of the control device, the first memory is a non-volatile memory, and the second memory is a volatile memory; inserting the fixed value data into the first address segment in the second memory according to the insertion segment positioning information; Calculate a second check code according to the fixed value data check code and the stored data, and modify the first check code in the second memory to the second check code, wherein the second check code is used to verify the stored data and the fixed value data; The stored data and the fixed value data in the second memory are read, and the stored data and the fixed value data are written into the first memory.

2. The data writing method according to claim 1, characterized in that: The parsed data file further includes an insertion segment step, the insertion segment positioning information includes at least one insertion segment sub-positioning information, the fixed value data includes at least one fixed value sub-data, the insertion segment step is used to represent the bit address interval between any two of the insertion segment sub-positioning information, and the at least one insertion segment sub-positioning information corresponds to the at least one fixed value sub-data in a one-to-one manner; The step of inserting the fixed value data into the first address segment in the second memory according to the insertion segment positioning information comprises: Calculate at least one insertion address of the at least one fixed value sub-data in the second memory according to the at least one insertion segment sub-location information and the insertion segment step length, wherein the at least one fixed value sub-data has a one-to-one correspondence with the at least one insertion address, and the at least one insertion address is an address in the first address segment; Inserting first fixed value sub-data into a first insertion address in the second memory, the first fixed value sub-data being data in the at least one fixed value sub-data, and the first insertion address being an address in the at least one insertion address corresponding to the first fixed value sub-data.

3. The data writing method according to claim 1, characterized in that: The processor is a management processor, and before parsing the data file to be parsed, the processor further includes: Receive remote operation and maintenance upgrade packages; Verifying the remote operation and maintenance upgrade package to obtain a verification result, wherein the verification result is used to indicate whether the remote operation and maintenance upgrade package carries the data file to be parsed; If the verification result indicates that the remote operation and maintenance upgrade package carries the data file to be parsed, the data file to be parsed is sent to at least one non-management processor.

4. The data writing method according to claim 3, characterized in that: The verification result is also used to indicate whether the remote operation and maintenance upgrade package carries at least one first update application package, and whether the remote operation and maintenance upgrade package carries a second update application package, the at least one first update application corresponds to the at least one non-management processor in a one-to-one manner, the at least one non-management processor is used to run the at least one first update application package, and the management processor is used to run the second update application package; If the verification result indicates that the remote operation and maintenance upgrade package carries the data file to be parsed, sending the data file to be parsed to at least one non-management processor includes: If the verification result indicates that the remote operation and maintenance upgrade package carries the data file to be parsed, the at least one first updated application package and the second updated application package, the data file to be parsed is sent to the at least one non-management processor, and the corresponding first updated application package is sent to the first non-management processor, and the first non-management processor is any one of the at least one non-management processor.

5. The data writing method according to claim 4, characterized in that: After sending the corresponding first update application package to the first non-management processor, the method further includes: installing the second update application based on the second update application package; If installation completion information is received from each of the at least one non-management processors, a whole machine reset instruction is executed, wherein the whole machine reset instruction is used to restart the control device, and the installation completion information is used to indicate that the corresponding first update application has been installed.

6. The data writing method according to claim 1, characterized in that: If it is detected that there is a data file to be parsed, the data file to be parsed is parsed to obtain a parsed data file, including: In response to a received power-on signal, detecting whether the data file to be parsed exists, the power-on signal being used to indicate that the control device has been restarted; If it is detected that the data file to be parsed exists, the data file to be parsed is parsed to obtain the parsed data file.

7. The data writing method according to claim 1, characterized in that: After reading the stored data and the fixed value data in the second memory and writing the stored data and the fixed value data into the first memory, the method further includes: Delete the parsed data file.

8. The data writing method according to any one of claims 1 to 7, characterized in that: The file format of the data file to be parsed is binary format.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the method as claimed in any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method as described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method for inserting code, device and storage medium

    CN101266549A

  • Distributed-type intelligent apparatus sub-module program automatic configuration method

    CN105094899A

  • Constant value file encryption method and related device

    CN113742754A

  • Local data rewrite method

    JP2019040376A