Management method and system for single-chip shared files

文档序号:1864722 发布日期:2021-11-19 浏览:2次 中文

阅读说明:本技术 一种单芯片共享文件的管理方法及系统 (Management method and system for single-chip shared files ) 是由 李二霞 亢超群 李玉凌 何连杰 孙智涛 张波 杨红磊 樊勇华 许保平 韩子龙 于 2020-05-15 设计创作,主要内容包括:本发明提供了一种单芯片共享文件的管理方法,包括:当收到应用对配电物联网中共享文件的访问命令时,根据所述应用的注册信息、命令类型发起针对所述应用对共享文件的交互请求;基于所述交互请求锁定文件标识访问接口,并在所述应用执行操作完成后下发结束命令对所述文件标识访问接口进行解锁;通过发起应用的交互请求,实现应用的调用配置及反馈,通过控制共享文件的操作锁定和解锁,实现共享文件的调用受控,保证应用交互数据完整,共享文件数据可靠。(The invention provides a management method of a single-chip shared file, which comprises the following steps: when an access command of an application to a shared file in a power distribution Internet of things is received, an interaction request aiming at the application to the shared file is initiated according to the registration information and the command type of the application; locking a file identifier access interface based on the interaction request, and issuing an end command to unlock the file identifier access interface after the application execution operation is completed; the calling configuration and feedback of the application are realized by initiating the interactive request of the application, the calling control of the shared file is realized by controlling the operation locking and unlocking of the shared file, the integrity of the interactive data of the application is ensured, and the data of the shared file is reliable.)

1. A management method for a single-chip shared file is characterized by comprising the following steps:

when an access command of an application to a shared file in a power distribution Internet of things is received, an interaction request aiming at the application to the shared file is initiated according to the registration information and the command type of the application;

and locking a file identifier access interface based on the interaction request, and issuing an end command to unlock the file identifier access interface after the application execution operation is completed.

2. The method of claim 1, wherein when receiving an access command of an application to a shared file in a power distribution internet of things, initiating an interactive request for the application to the shared file according to the registration information and the command type of the application comprises:

when an access command of an application to a shared file in the power distribution Internet of things is received, inquiring application registration information, and judging the type of the command based on an inquiry result;

when the command type is a single command, calling a file direct access interface to access the shared file;

when the command type is a command stream, initiating an occupation application and judging the occupation sequence of each application to the file, when obtaining an occupation permission operation shared file, initiating an interaction request aiming at the application to operate, releasing the occupation permission after the operation is finished, and then allowing the next application to occupy.

3. The method of claim 2, wherein locking the file identification access interface based on the interactive request comprises:

if the shared file is not occupied in the operation process, a timer is adopted for setting a file identification access interface at regular time, the file identification access interface is locked, and the shared file is accessed in the set time based on the application index and the interaction request to perform read-write operation;

and if the shared file is occupied in the operation process, locking the shared file.

4. The method of claim 3, wherein locking the file identification access interface based on the interactive request further comprises:

and if the shared file is not in the operation flow, the application returns an error state.

5. The method of claim 4, wherein issuing an end command to unlock the file identification access interface after the application execution operation is completed comprises:

and when the application finishes accessing the shared file or the timing time is up, issuing an ending command, and closing the application process identifier, the occupation permission of the file and the timer switch.

6. A system for managing a file shared on a single chip, comprising: the application calls the control module and file operation management module;

the application call control module is used for initiating an interactive request aiming at the application to the shared file according to the registration information and the command type of the application when receiving an access command of the application to the shared file in the power distribution internet of things;

and the file operation management module is used for locking a file identifier access interface based on the interaction request and issuing an end command to unlock the file identifier access interface after the application execution operation is completed.

7. The system of claim 6, wherein the application invokes a control module comprising: the command judging submodule, the single command calling submodule and the command stream calling submodule are arranged;

the command judgment sub-module is used for inquiring application registration information when receiving an access command of an application to a shared file in the power distribution internet of things, and judging the type of the command based on an inquiry result;

the single command calling sub-module is used for calling a file direct access interface to access the shared file when the command type is a single command;

the command stream calling sub-module is used for initiating an occupation application and judging the occupation sequence of each application to the file when the command type is the command stream, initiating an interaction request for the application to operate when the shared file is operated by the occupation permission, releasing the occupation permission after the operation is finished, and then allowing the next application to be occupied.

8. The system of claim 7, wherein the file operation management module comprises: locking the sub-module;

and the locking submodule is used for locking the file identification access interface based on the interaction request.

9. The system of claim 8, wherein the locking submodule comprises: an error state cell, an unoccupied cell, and an occupied cell;

the error state unit is used for returning an error state by the application if the shared file is not in the operation process;

the unoccupied unit is used for setting a file identification access interface at regular time by adopting a timer if the shared file is unoccupied in the operation process, locking the file identification access interface, accessing the shared file within the set time based on the application index and the interaction request, and performing read-write operation;

and the occupied unit is used for locking the shared file if the shared file is occupied in the operation process.

10. The system of claim 9, wherein the file operation management module further comprises: unlocking the sub-module;

and the unlocking submodule is used for issuing an ending command and closing the application process identification, the occupation permission of the file and the timer switch when the application accesses the shared file or the timing time is up.

Technical Field

The invention belongs to the technical field of security chip design, and particularly relates to a management method and a management system for a single-chip shared file.

Background

Under the framework of a power distribution internet of things sensing layer, a communication layer, a platform layer and an application layer, the safety functions of the sensing layer edge internet of things agent and the internet of things terminal are realized on the basis of a safety chip.

The safety chip is a device which can independently generate and encrypt and decrypt a key, has an independent processor and a storage unit inside, can store the key and the characteristic data, and provides encryption and decryption and safety authentication services for safety application.

The safety chip can provide encryption protection of service data for the application in a customized mode, and can safely store and transmit application data. Under the scene of the power distribution internet of things, multi-service application integration deployment such as power distribution automation, marketing and electric vehicles is adopted, and a safety chip of the edge internet of things agent needs to support safety services of various types of service applications so as to meet the safety access requirements under different service scenes.

The file stored in the chip has read or write operations in the application flow, some transaction operations are completed by a plurality of commands, and the application flow can ensure that the operation sequence of the file is correct in a single application. However, when a plurality of applications need to operate a shared file, a flow that one application 1 is performing shared file operation may be inserted by another application 2, and the operation of the application 2 on the shared file may affect the operation result of the application 1, resulting in data confusion. The current power system safety chips such as the special safety chip for power distribution, the power consumption information acquisition chip and the like all support single application functions, and do not have the capability of providing services for multiple applications.

Disclosure of Invention

Aiming at the defects that when a plurality of existing applications need to operate a shared file, the process that one application 1 is performing the shared file operation is possibly inserted into another application 2, and the operation of the application 2 on the shared file can influence the operation result of the application 1 to cause data confusion, the invention provides a management method of a single-chip shared file, which specifically comprises the following steps:

when an access command of an application to a shared file in a power distribution Internet of things is received, an interaction request aiming at the application to the shared file is initiated according to the registration information and the command type of the application;

and locking a file identifier access interface based on the interaction request, and issuing an end command to unlock the file identifier access interface after the application execution operation is completed.

Preferably, when receiving an access command of an application to a shared file in the power distribution internet of things, initiating an interactive request for the application to the shared file according to the registration information and the command type of the application includes:

when an access command of an application to a shared file in the power distribution Internet of things is received, inquiring application registration information, and judging the type of the command based on an inquiry result;

when the command type is a single command, calling a file direct access interface to access the shared file;

when the command type is a command stream, initiating an occupation application and judging the occupation sequence of each application to the file, when obtaining an occupation permission operation shared file, initiating an interaction request aiming at the application to operate, releasing the occupation permission after the operation is finished, and then allowing the next application to occupy.

Preferably, the locking the file identification access interface based on the interaction request includes:

if the shared file is not occupied in the operation process, a timer is adopted for setting a file identification access interface at regular time, the file identification access interface is locked, and the shared file is accessed in the set time based on the application index and the interaction request to perform read-write operation;

and if the shared file is occupied in the operation process, locking the shared file.

Preferably, the locking the file identifier access interface based on the interaction request further includes:

and if the shared file is not in the operation flow, the application returns an error state.

Preferably, the issuing of the end command to unlock the file identifier access interface after the application execution operation is completed includes:

and when the application finishes accessing the shared file or the timing time is up, issuing an ending command, and closing the application process identifier, the occupation permission of the file and the timer switch.

Based on the same conception, the invention provides a management system of a single-chip shared file, which comprises the following components: the application calls the control module and file operation management module;

the application call control module is used for initiating an interactive request aiming at the application to the shared file according to the registration information and the command type of the application when receiving an access command of the application to the shared file in the power distribution internet of things;

and the file operation management module is used for locking a file identifier access interface based on the interaction request and issuing an end command to unlock the file identifier access interface after the application execution operation is completed.

Preferably, the application call control module includes: the command judging submodule, the single command calling submodule and the command stream calling submodule are arranged;

the command judgment sub-module is used for inquiring application registration information when receiving an access command of an application to a shared file in the power distribution internet of things, and judging the type of the command based on an inquiry result;

the single command calling sub-module is used for calling a file direct access interface to access the shared file when the command type is a single command;

the command stream calling sub-module is used for initiating an occupation application and judging the occupation sequence of each application to the file when the command type is the command stream, initiating an interaction request for the application to operate when the shared file is operated by the occupation permission, releasing the occupation permission after the operation is finished, and then allowing the next application to be occupied.

Preferably, the file operation management module includes: locking the sub-module;

and the locking submodule is used for locking the file identification access interface based on the interaction request.

Preferably, the locking submodule includes: an error state cell, an unoccupied cell, and an occupied cell;

the error state unit is used for returning an error state by the application if the shared file is not in the operation process;

the unoccupied unit is used for setting a file identification access interface at regular time by adopting a timer if the shared file is unoccupied in the operation process, locking the file identification access interface, accessing the shared file within the set time based on the application index and the interaction request, and performing read-write operation;

and the occupied unit is used for locking the shared file if the shared file is occupied in the operation process.

Preferably, the file operation management module further includes: unlocking the sub-module;

and the unlocking submodule is used for issuing an ending command and closing the application process identification, the occupation permission of the file and the timer switch when the application accesses the shared file or the timing time is up.

Compared with the prior art, the invention has the beneficial effects that:

1. the invention provides a management method of a single-chip shared file, which comprises the following steps: when an access command of an application to a shared file in a power distribution Internet of things is received, an interaction request aiming at the application to the shared file is initiated according to the registration information and the command type of the application; locking a file identifier access interface based on the interaction request, and issuing an end command to unlock the file identifier access interface after the application execution operation is completed; the calling configuration and feedback of the application are realized by initiating the interactive request of the application, the calling control of the shared file is realized by controlling the operation locking and unlocking of the shared file, the integrity of the interactive data of the application is ensured, and the data of the shared file is reliable.

2. The invention provides a management method and a management system for a single-chip shared file, which solve the problem that the operation of the same file on a chip is not influenced by independent calling of application functions and transaction commands of different applications, and ensure that the content of the file is updated and controlled.

Drawings

FIG. 1 is a flow chart of a method provided by the present invention;

fig. 2 is a schematic diagram of a power distribution internet of things architecture provided in an embodiment of the present invention;

FIG. 3 is a diagram of a file operation management module according to an embodiment of the present invention;

FIG. 4 is a schematic diagram of an application access control module according to an embodiment of the present invention;

FIG. 5 is a diagram illustrating an exemplary use of an embodiment of the present invention;

fig. 6 is a system configuration diagram provided by the present invention.

Detailed Description

The embodiments of the present invention will be further described with reference to the accompanying drawings.

Example 1:

the invention provides a management method and a management system for a single-chip shared file, which are used for realizing that when a plurality of applications operate the shared file, the operation of each application on the file independently exists without mutual influence, and ensuring that the content of the file is updated and controlled. The invention can be popularized to the conflict resolution of multiple application files of security chips in other fields, and is introduced by combining with the method flow chart of fig. 1, and the method specifically comprises the following steps:

step 1: when an access command of an application to a shared file in a power distribution Internet of things is received, an interaction request aiming at the application to the shared file is initiated according to the registration information and the command type of the application;

step 2: locking a file identifier access interface based on the interaction request, and issuing an end command to unlock the file identifier access interface after the application execution operation is completed;

wherein, the step 1: when an access command of an application to a shared file in a power distribution internet of things is received, an interactive request aiming at the application to the shared file is initiated according to the registration information and the command type of the application, and the method specifically comprises the following steps:

(1) file operation management module

The file operation management module comprises a timer submodule, a file access control submodule and an application interaction submodule. As shown in fig. 3.

The file access control sub-module provides control and state query of file operation, and queries whether the identification file is occupied by an application process, including accessible file application management, occupied identification registration management and timer setting management;

the timer submodule comprises a timer and a switch thereof;

the application interaction sub-module is responsible for interaction of the application control module and provides a file direct access interface and a file identification access interface.

When an application needs to access a shared file, if the application needs to access the shared file, the file direct access interface is called to complete the read-write operation of a command; if the read-write operation is finished by a plurality of commands, calling a file identification access interface, submitting the application index, the interaction request and the interaction time data to an application interaction submodule, applying a file access control submodule by the interaction submodule to find whether the application has the authority to access the file, if so, continuing to judge whether the application is occupied by other application processes, and if so, locking the shared file, namely, returning a module busy state; and if the terminal is not occupied, applying for occupation, starting a timer, setting a timer value, and recording the application index. And starting the timer, registering and modifying the unoccupied state if the registration identifier is not cleared when the timer is up, and turning off the timer. If the ending command of the application flow comes, whether the application occupies the file control right or not is judged, if the application occupies the file control right, the service flow is normally closed by the application ending command, and the application flow identifier, the file occupation identifier and the timer switch are closed.

Step 2: locking a file identifier access interface based on the interaction request, and issuing an end command to unlock the file identifier access interface after the application execution operation is completed, specifically comprising:

(2) control module for application calling file system access

The control module for an application invoking file system access is shown in fig. 4. The module is mainly responsible for operation control of each application and comprises an application registry and a file operation calling submodule. After receiving an application instruction, searching an application registry (information), judging whether the instruction is a single command operation file (one application needs to access one shared file) or a command stream operation file (a plurality of applications need to access one shared file), if the instruction is a single command operation, directly calling a file operation management module to directly access the file, and if the instruction is a command stream operation, continuing to perform subsequent judgment.

When receiving an initial operation command of an application, applying for file occupation to a file operation management module, and if the application obtains permission, recording that the application enters an operation flow; if the permission is not obtained, the application returns to the system busy state, and the application starts to operate and refuse the state. If the module receives the application operation process command, the module inquires whether the application is in the operation process, if so, the module continues, otherwise, the module returns to an error state. If the module receives an application operation ending command, whether the application is in the operation process is inquired, if not, an error state is reported, and if so, the module applies for updating the file to the file operation management module and ends occupation.

(3) Entity carrying file system module and application calling control

The shared file management entity comprises an application access control module and a file operation management module, and the entity can ensure that when multiple applications access the shared file, the file access control module independently applies operation locking on the file, so that the calling of the shared file is controlled, the application interactive data is ensured to be complete, and the shared file data is reliable.

In order to meet the requirement that multiple service applications call one security chip simultaneously in the scene of the power distribution internet of things, chips supporting multiple application operations need to be designed and researched. In the design process, the problem that the operation of the same file of the chip is complementarily influenced by independent calling of application functions and different application transaction commands needs to be solved. Based on the above requirements, it is urgently needed to develop a management method for sharing files in a security chip to schedule the use of chip resources by different applications, and ensure the low-investment and high-efficiency implementation of security functions of different business applications in the scene of power distribution internet of things, which is introduced in combination with the power distribution internet of things architecture diagram of fig. 2, and an application calling control module and a file operation management module are located at an edge internet of things agent and an internet of things terminal.

When the method is not used, each application has no problem when independently interacting with the chip, but a plurality of applications access the chip simultaneously, and each flow is disordered when the applications are alternated, and the specific problems are as follows:

using 1 a first command to access a shared file and read out file data A

Using 2 a first command to access the shared file and read out the file data A

1, finishing the operation of A + B updating the shared file data by applying a second command to obtain (A + B)

The second command operation is applied 2 to complete A + C updating the shared file data as (A + C)

And adding the shared file by the two applications, wherein the expected result of the application 1 is to obtain the data value + B of the file, the expected result of the application 2 is to obtain the data value + C of the file, and the expected data value of the shared file after the execution of the two application flows is to obtain A + B + C, but the actual result is that A + C is not correct.

By way of introduction with reference to the use example diagram of fig. 5, the command stream operation of the present application, application 1 application a, does not complete the next command to execute the operation. When the application 2 applies for, the chip is returned to be busy, namely, the access of the file is locked, and the application 2 is not allowed to operate until the next command is executed and the file becomes the value of A + B. At this time, the file value read by the application 2 is A + B, and then the + C operation of the application is executed, and the calculation result is changed into A + B + C.

The method can solve the problem of the multi-application operation shared file, adopts a mode of interlocking the shared files among the applications, locks the shared files without accepting the operation of other applications before the operation process of the application 1 is started and is not finished, and unlocks and locks other applications after the operation process is finished. The same is true for the operation of application 2. And considering the risk that the file cannot be released due to the locked state caused by the interruption of the instruction stream of the application 1, a mechanism for releasing the occupation of the shared file at regular time by the application service stream is also added.

The content of the invention comprises a file operating system module, a control module for calling the file system access by application and an entity for carrying the file system module and the application calling control. The operation locking and unlocking of the shared file are controlled through the file operating system module, the calling configuration and feedback of the application are realized through the application calling control module according to the application registry, the file is locked without accepting the access of the application 2 when the calling of the application 1 is not finished, and the unlocking is realized after the calling is finished, so that the calling control of the shared file is realized, the integrity of application interactive data is ensured, and the data of the shared file is reliable.

Example 2:

based on the same concept, the present invention provides a single-chip file sharing management system, which is introduced in conjunction with the system structure diagram of fig. 6, and specifically includes: the application calls the control module and file operation management module;

the application call control module is used for initiating an interactive request aiming at the application to the shared file according to the registration information and the command type of the application when receiving an access command of the application to the shared file in the power distribution internet of things;

and the file operation management module is used for locking a file identifier access interface based on the interaction request and issuing an end command to unlock the file identifier access interface after the application execution operation is completed.

The application call control module comprises: the command judging submodule, the single command calling submodule and the command stream calling submodule are arranged;

the command judgment sub-module is used for inquiring application registration information when receiving an access command of an application to a shared file in the power distribution internet of things, and judging the type of the command based on an inquiry result;

the single command calling sub-module is used for calling a file direct access interface to access the shared file when the command type is a single command;

the command stream calling sub-module is used for initiating an occupation application and judging the occupation sequence of each application to the file when the command type is the command stream, initiating an interaction request for the application to operate when the shared file is operated by the occupation permission, releasing the occupation permission after the operation is finished, and then allowing the next application to be occupied.

The file operation management module comprises: locking the sub-module;

and the locking submodule is used for locking the file identification access interface based on the interaction request.

The locking submodule, comprising: an error state cell, an unoccupied cell, and an occupied cell;

the error state unit is used for returning an error state by the application if the shared file is not in the operation process;

the unoccupied unit is used for setting a file identification access interface at regular time by adopting a timer if the shared file is unoccupied in the operation process, locking the file identification access interface, accessing the shared file within the set time based on the application index and the interaction request, and performing read-write operation;

and the occupied unit is used for locking the shared file if the shared file is occupied in the operation process.

The file operation management module further comprises: unlocking the sub-module;

and the unlocking submodule is used for issuing an ending command and closing the application process identification, the occupation permission of the file and the timer switch when the application accesses the shared file or the timing time is up.

The application calling control module and the file operation management module are located at the edge Internet of things agent and the Internet of things terminal.

As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

The present invention is not limited to the above embodiments, and any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are included in the scope of the claims of the present invention which are filed as the application.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:通信过程中的权限协商方法、装置和电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类