Chip program upgrading method, communication device and computer readable storage medium

文档序号:7219 发布日期:2021-09-17 浏览:113次 中文

1. A chip program upgrading method is applied to a service card in communication equipment, the communication equipment further comprises a main control card, and the method comprises the following steps:

when the program of the single chip microcomputer is determined to be required to be upgraded, acquiring the program to be upgraded from a loading area of the main control card;

and loading the program to be upgraded into an operation area of the single chip microcomputer to operate so as to upgrade the program of the single chip microcomputer, wherein the operation area is used for storing the current operation program.

2. The method of claim 1, wherein whether the program of the single chip microcomputer needs to be upgraded is determined by:

and judging whether the loading mark of the single chip microcomputer represents that upgrading is needed, if so, determining that the program of the single chip microcomputer needs to be upgraded.

3. The method of claim 2, wherein before determining whether the loading flag of the single chip microcomputer indicates that upgrading is required, the method further comprises:

receiving an upgrade mark sent by the master control card, wherein the upgrade mark is generated by the master control card when the singlechip is determined to be required to be upgraded;

and updating the loading mark in the singlechip according to the upgrading mark.

4. The method according to claim 1, wherein the obtaining the program to be upgraded from the loading area of the main control card comprises:

and sending an upgrade request carrying a corresponding loading mark to the main control card so that the main control card reads a program to be upgraded from a corresponding loading area according to the loading mark and sends the program to the service card, wherein the loading mark is used for representing the mark of the loading area in the main control card.

5. The method of claim 4, further comprising:

and if the program upgrading of the single chip microcomputer is determined to be failed after the preset time length, acquiring the program to be upgraded from the other loading area of the main control card for upgrading.

6. A chip program upgrading method is applied to a main control card in communication equipment, the communication equipment also comprises a service card, and the method comprises the following steps:

receiving an upgrading request sent by the service card;

reading a program to be upgraded from a loading area of the main control card according to the upgrading request;

and sending the program to be upgraded to the service card so that the service card loads the program to be upgraded to an operation area of a single chip microcomputer of the service card for operation, so as to upgrade the program of the single chip microcomputer, wherein the operation area is used for storing the current operation program.

7. The method according to claim 6, wherein the main control card includes a main loading area and a standby loading area, the upgrade request carries a corresponding loading mark representing the loading area, and the reading of the program to be upgraded from the loading area of the main control card according to the upgrade request includes:

acquiring a loading mark from the upgrading request;

if the loading mark is the loading mark of the main loading area, reading a program to be upgraded from the main loading area;

and if the loading mark is the loading mark of the standby loading area, reading the program to be upgraded from the standby loading area.

8. The method of claim 6, wherein before receiving the upgrade request sent by the service card, the method further comprises:

and when detecting that the program to be upgraded in the loading area of the main control card is updated, sending corresponding prompt information to the service card.

9. A communication device, characterized in that the communication device comprises a master control card and a service card;

the service card is used for sending an upgrading request to the main control card when the program of the single chip microcomputer is determined to be upgraded;

the main control card is used for acquiring a program to be upgraded from a loading area of the main control card according to the upgrading request and sending the program to be upgraded to the service card;

the service card is also used for loading the program to be upgraded into an operation area of the single chip microcomputer to operate so as to upgrade the program of the single chip microcomputer, and the operation area is used for storing the current operation program.

10. A computer-readable storage medium storing computer instructions which, when executed by a computer, perform the chip program upgrade method according to any one of claims 1 to 5 or perform the chip program upgrade method according to any one of claims 6 to 8.

Background

At present, a rack-mounted communication device generally includes board cards such as a main control card and a service card, and the service card generally includes an intelligent chip to acquire identity information and operation parameters of the board card and report the identity information and the operation parameters to the main control card. The singlechip is widely applied to the business card of the rack-mounted equipment due to the characteristics of low cost, simple design and the like. Generally, in view of cost, the operating program of the single chip microcomputer is stored in a built-in storage medium, and when the service of the service card is extended, the operating program of the single chip microcomputer needs to be upgraded.

However, as the service function of the service card changes, the space where the upgrade program stored in the loading area is located will become larger and larger, and the space where the upgrade program is operated in the operating area will also become larger and larger, and in view of cost, the storage space of the storage medium built in the single chip microcomputer is basically not large, so that the service function expansion of the service card is limited. If the storage space is enlarged, an external memory is designed for the single chip microcomputer or the single chip microcomputer with larger storage space is used, but the cost of the rack-mounted communication equipment is undoubtedly increased.

Disclosure of Invention

An object of the embodiments of the present application is to provide a chip program upgrading method, a communication device, and a computer-readable storage medium, so as to solve the problem that the prior art cannot consider both the device cost and the service function extension of a board.

In a first aspect, an embodiment of the present application provides a method for upgrading a chip program, where the method is applied to a service card in a communication device, where the communication device further includes a master control card, and the method includes:

when the program of the single chip microcomputer is determined to be required to be upgraded, acquiring the program to be upgraded from a loading area of the main control card;

and loading the program to be upgraded into an operation area of the single chip microcomputer to operate so as to upgrade the program of the single chip microcomputer, wherein the operation area is used for storing the current operation program.

In the implementation process, the program to be upgraded is stored in the loading area of the main control card instead of the loading area of the single chip microcomputer, so that the equipment cost can be saved without adding a storage medium for the service card and increasing the storage space of the single chip microcomputer, and more storage spaces can be provided for the operation area of the single chip microcomputer because the single chip microcomputer is not provided with the loading area, so that the operation mirror image files with more functions expanded by the service card can be stored in the operation area for operation, and the function expansion of the service card is facilitated. Therefore, the method can give consideration to both the equipment cost and the function expansion of the service card.

Optionally, it is determined whether the program of the single chip microcomputer needs to be upgraded by:

and judging whether the loading mark of the single chip microcomputer represents that upgrading is needed, if so, determining that the program of the single chip microcomputer needs to be upgraded. Therefore, whether the program of the single chip microcomputer needs to be upgraded or not can be quickly judged according to the loading mark.

Optionally, before determining whether the loading flag of the single chip microcomputer represents that upgrading is required, the method further includes:

receiving an upgrade mark sent by the master control card, wherein the upgrade mark is generated by the master control card when the singlechip is determined to be required to be upgraded;

and updating the loading mark in the singlechip according to the upgrading mark.

In the implementation process, the program to be upgraded is stored in the loading area in the main control card, so that whether the program of the single chip microcomputer needs to be upgraded can be sensed in real time through the main control card, and the processing resource of the single chip microcomputer does not need to be occupied. And in this way, the problem that the main control card directly sends the program to be upgraded to the service card, and the singlechip is not provided with a loading area for storing the program to be upgraded, so that the program currently running in the running area can be directly covered by the program to be upgraded (the program in the running area cannot be covered during running) to cause abnormal operation of the singlechip can be avoided.

Optionally, the obtaining the program to be upgraded from the loading area of the main control card includes:

and sending an upgrade request carrying a corresponding loading mark to the main control card so that the main control card reads a program to be upgraded from a corresponding loading area according to the loading mark and sends the program to the service card, wherein the loading mark is used for representing the mark of the loading area in the main control card.

In the implementation process, the main control card is provided with a main loading area and a standby loading area, so that the business card acquires the corresponding program to be upgraded from the loading area corresponding to the main control card by sending an upgrading request to the main control card, and the upgrading reliability of the single chip microcomputer can be ensured.

Optionally, the method further comprises:

and if the program upgrading of the single chip microcomputer is determined to be failed after the preset time length, acquiring the program to be upgraded from the other loading area of the main control card for upgrading. Therefore, when the single chip microcomputer fails to be upgraded, the program to be upgraded can be obtained from the other loading area to be upgraded continuously, and the upgrading reliability is ensured.

In a second aspect, an embodiment of the present application provides a method for upgrading a chip program, where the method is applied to a main control card in a communication device, where the communication device further includes a service card, and the method includes:

receiving an upgrading request sent by the service card;

reading a program to be upgraded from a loading area of the main control card according to the upgrading request;

and sending the program to be upgraded to the service card so that the service card loads the program to be upgraded to an operation area of a single chip microcomputer of the service card for operation, so as to upgrade the program of the single chip microcomputer, wherein the operation area is used for storing the current operation program.

In the implementation process, the program to be upgraded is stored in the loading area of the main control card instead of the loading area of the single chip microcomputer, so that the equipment cost can be saved without adding a storage medium for the service card and increasing the storage space of the single chip microcomputer, and more storage spaces can be provided for the operation area of the single chip microcomputer because the single chip microcomputer is not provided with the loading area, so that the operation mirror image files with more functions expanded by the service card can be stored in the operation area for operation, and the function expansion of the service card is facilitated. Therefore, the method can give consideration to both the equipment cost and the function expansion of the service card.

Optionally, the main control card includes a main loading area and a standby loading area, the upgrade request carries a corresponding loading mark representing the loading area, and the reading of the program to be upgraded from the loading area of the main control card according to the upgrade request includes:

acquiring a loading mark from the upgrading request;

if the loading mark is the loading mark of the main loading area, reading a program to be upgraded from the main loading area;

and if the loading mark is the loading mark of the standby loading area, reading the program to be upgraded from the standby loading area.

In the implementation process, the main loading area and the standby loading area are used for storing the program to be upgraded, so that the reliability of the single chip microcomputer in the upgrading process can be ensured.

Optionally, before receiving the upgrade request sent by the service card, the method further includes:

and when detecting that the program to be upgraded in the loading area of the main control card is updated, sending corresponding prompt information to the service card. Therefore, the service card can acquire the program to be upgraded from the main control card to operate when the operation area does not operate, and the problem of abnormal operation caused by the fact that the single chip microcomputer acquires the program to be upgraded and directly covers the operation area due to the fact that the current program is operated in the operation area is solved.

In a third aspect, an embodiment of the present application provides a communication device, where the communication device includes a master control card and a service card;

the service card is used for sending an upgrading request to the main control card when the program of the single chip microcomputer is determined to be upgraded;

the main control card is used for acquiring a program to be upgraded from a loading area of the main control card according to the upgrading request and sending the program to be upgraded to the service card;

the service card is also used for loading the program to be upgraded into an operation area of the single chip microcomputer to operate so as to upgrade the program of the single chip microcomputer, and the operation area is used for storing the current operation program.

In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, performs the steps of the method as provided in the first or second aspect.

Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.

Fig. 1 is a schematic diagram illustrating a distribution situation of each board card in a communication device according to an embodiment of the present application;

fig. 2 is a flowchart of a method for upgrading a chip program according to an embodiment of the present application;

fig. 3 is a schematic diagram of a memory partition of a main control card according to an embodiment of the present disclosure;

fig. 4 is a flowchart of another chip program upgrading method provided in an embodiment of the present application;

fig. 5 is a block diagram of a chip program upgrading apparatus according to an embodiment of the present disclosure;

fig. 6 is a block diagram of another chip program upgrading apparatus according to an embodiment of the present disclosure.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.

As shown in fig. 1, fig. 1 is a schematic view of a distribution situation of each board card in a rack-mounted communication device, where the communication device includes a main control card and a plurality of service cards, the plurality of service cards are connected with the main control card respectively, and each service card includes a single chip, which can be used for management of own board card information and operation parameters, such as obtaining information of identity, temperature, and the like of the own board card and reporting the information to the main control card. In order to save cost, the operating program of the single chip microcomputer in the service card is usually stored in the built-in memory, and the storage area of the single chip microcomputer is usually divided into a starting area, an operating area and a loading area in consideration of reliability. The starting area is used for storing codes related to starting of the single chip microcomputer, updating is usually not performed, the operation area is used for storing a currently operated program and cannot be covered during operation, and the loading area is used for temporarily storing a program to be upgraded during program upgrading.

And when the single chip microcomputer is started, executing the program in the starting area, and if the program to be upgraded in the loading area is detected, loading the program to be upgraded into the operation area for operation. Under a common condition, in order to facilitate version management, when the same type of single chip microcomputer is deployed on different service cards, if the functions of the different service cards are different, the single chip microcomputer still can be packaged into an operation image file to be stored in the single chip microcomputer. If the service card needs to expand more functions, the storage space occupied by the same running image file is increased, but based on cost consideration, the storage space of a memory built in the single chip microcomputer is basically not large, so that the software function expansion of the service card is limited. Moreover, if the single chip microcomputer is designed to expand a memory or is replaced by the single chip microcomputer with larger memory space, the equipment cost is increased undoubtedly.

The above prior art solutions have shortcomings which are the results of practical and careful study of the inventor, and therefore, the discovery process of the above problems and the solutions proposed by the following embodiments of the present invention to the above problems should be the contribution of the inventor to the present invention in the course of the present invention.

In order to solve the above technical problems, an embodiment of the present application provides a method for upgrading a chip program, in which a program to be upgraded is stored in a loading area of a main control card instead of a loading area of a single chip microcomputer, so that it is not necessary to add a storage medium to a service card and increase a storage space of the single chip microcomputer, and equipment cost can be saved. Therefore, the method can give consideration to both the equipment cost and the function expansion of the service card.

Referring to fig. 2, fig. 2 is a flowchart of a method for upgrading a chip program according to an embodiment of the present application, where the method is applied to a service card, and includes the following steps:

step S110: and when the program of the single chip microcomputer is determined to be required to be upgraded, acquiring the program to be upgraded from the loading area of the main control card.

It can be understood that the chip program upgrading method provided by the present application is executed by a single chip in a service card, and for convenience of description, the following embodiments all describe with the service card as an execution subject.

In the embodiment of the application, the main control card divides a storage space of a storage medium of the main control card as a loading area for storing a program to be upgraded for upgrading the program of the single chip microcomputer, wherein the program to be upgraded can be input into the main control card by an administrator or downloaded from a network by the main control card. Therefore, when the service card determines that the program of the single chip microcomputer needs to be upgraded, the service card can acquire the program to be upgraded from the loading area of the main control card.

In some embodiments, after the service card is powered on and started, the service card may first determine whether the program of the single chip microcomputer needs to be upgraded, and when the service card determines that the program of the single chip microcomputer needs to be upgraded, the service card may send an upgrade request to the main control card, and after receiving the upgrade request, the main control card reads the program to be upgraded from the loading area of the main control card according to the upgrade request, and then sends the program to be upgraded to the service card. Therefore, the problem that the main control card directly sends the program to be upgraded to the service card, and the singlechip is not provided with a loading area for storing the program to be upgraded, so that the program currently running in the running area is directly covered by the program to be upgraded (the program in the running area cannot be covered during running) and the singlechip runs abnormally can be avoided.

The program to be upgraded can be understood as a related program for implementing the control and operation maintenance functions of the single chip microcomputer, such as configuration of forwarding logic of the service card, temperature alarm configuration, state reporting configuration, and the like. Namely, the programs for upgrading the running programs of the single chip microcomputer according to the functions of the service card, and the programs can be called as programs to be upgraded.

Step S120: and loading the program to be upgraded into the operation area of the single chip microcomputer to operate so as to upgrade the program of the single chip microcomputer.

The single chip microcomputer is not required to be provided with a loading area, and only the starting area and the operation area are required to be arranged, so that when the service card is started in a power-on mode, the program in the starting area is operated firstly, if the program of the single chip microcomputer is detected to be required to be upgraded, if the program is required to be upgraded, the program to be upgraded is obtained from the main control card, and after the program to be upgraded is obtained by the single chip microcomputer, the program to be upgraded can be directly loaded into the operation area to operate, so that the program of the single chip microcomputer is upgraded, and the operation program in the single chip microcomputer is upgraded. The operation area is used for storing the current operation program, so that the upgrading of the operation program of the singlechip can be completed after the program to be upgraded is operated in the operation area.

The loading of the program to be upgraded into the running area may be understood as covering the program to be upgraded into the running area, or storing the program to be upgraded into the running area, and may be flexibly set according to the requirements of the user.

In the implementation process, the program to be upgraded is stored in the loading area of the main control card instead of the loading area of the single chip microcomputer, so that the equipment cost can be saved without adding a storage medium for the service card and increasing the storage space of the single chip microcomputer, and more storage spaces can be provided for the operation area of the single chip microcomputer because the single chip microcomputer is not provided with the loading area, so that the operation mirror image files with more functions expanded by the service card can be stored in the operation area for operation, and the function expansion of the service card is facilitated. Therefore, the method can give consideration to both the equipment cost and the function expansion of the service card.

On the basis of the embodiment, the main control card is divided into the loading area in advance, and the loading area is used for storing the program to be upgraded. After obtaining the program to be upgraded, the main control card may perform preliminary verification on the program to be upgraded to check the validity thereof, for example, a check core of the program to be upgraded is generated in advance, and after obtaining the program to be upgraded, the program to be upgraded is verified by using the check core; or the master control card obtains the ID of each service card in the program to be upgraded, and after obtaining the ID of each service card in the program to be upgraded, the master control card determines whether each service card is the same as the service card connected to the master control card, if not, the master control card determines that the program to be upgraded is not the upgrading program of the service card connected to the master control card, and if not, the verification is not passed, otherwise, the verification is passed. And after the program to be upgraded is determined to be legal, storing the program to be upgraded in a loading area of the main control card.

Or, after the service card obtains the program to be upgraded, the service card may also check the program to be upgraded first, and the checking process is similar to that of the main control card, which is not repeated herein.

When the master control card detects that the program to be upgraded in the loading area of the master control card is updated (if the currently acquired program to be upgraded is compared with the program to be upgraded which is stored in the loading area historically, if the currently acquired program to be upgraded is different from the program to be upgraded, the program to be upgraded is determined to be updated), the master control card can send indication information to the service card so as to indicate that the program of the single chip microcomputer of the service card can be upgraded, and the service card can determine that the program of the single chip microcomputer of the service card needs to be upgraded after receiving the indication information.

It can be understood that, if the main control card is connected with a plurality of service cards, the main control card sends the indication information to each service card, so that when the program of the single chip microcomputer is upgraded, the programs of the single chip microcomputers in the plurality of service cards can be upgraded in batch, the upgrading efficiency is higher, the upgrading process of the program of the single chip microcomputer in each service card is the same, and the upgrading of the program of the single chip microcomputer in one service card is taken as an example in the embodiment of the present application for explanation. Or, the main control card may also send the indication information to the service card that needs to be upgraded according to the user's requirement, for example, the user may send an instruction to the main control card, where the instruction carries the ID of the service card, and the main control card may send the indication information to the corresponding service card according to the ID of the service card, so as to indicate that the program of the single chip microcomputer of the service needs to be upgraded.

In other embodiments, in order to facilitate the service card to determine whether the program of the single chip microcomputer needs to be upgraded, the main control card may further generate an upgrade flag after obtaining the program to be upgraded, that is, when the main control card determines that the program of the single chip microcomputer in the service card needs to be upgraded (if the currently obtained program to be upgraded is not consistent with the pre-stored program to be upgraded, it is determined that the program of the single chip microcomputer needs to be upgraded), and then generate an upgrade flag. The main control card sends the upgrade mark to the service card, and the service card can determine whether the program of the single chip microcomputer needs to be upgraded according to the upgrade mark.

The service card can be marked with a corresponding loading mark in advance, the loading mark is used for representing whether the program of the single chip microcomputer needs to be upgraded or not, after the service card receives the upgrading mark sent by the main control card, the upgrading mark can be compared with the loading mark recorded by the service card, if the upgrading mark is different from the loading mark, the loading mark is updated according to the upgrading mark, and if the loading mark is updated to the upgrading mark, or the loading mark is updated to other marks, the service card can sense the change of the loading mark. Therefore, when the service card detects that the loading mark representation of the single chip microcomputer needs to be upgraded, the service card determines that the program of the single chip microcomputer needs to be upgraded.

For example, when the system is initially powered on, the single chip microcomputer may automatically generate an initial loading mark (e.g., 00), or the main control card issues the generated initial loading mark to the service card, the main control card generates an upgrade mark (e.g., 01) after obtaining a program to be upgraded and sends the upgrade mark to the service card, the service card updates the initial loading mark to the upgrade mark, the loading mark recorded in the service card becomes 01 at this time, and if the service card detects that the loading mark is 01 (indicating that the loading mark represents that the upgrading is required), it is determined that the program of the single chip microcomputer needs to be upgraded. After the program of the single chip microcomputer is upgraded, the service card can update the loading mark to the initial loading mark again, if the loading mark is updated to 00, then the service card detects whether the loading mark changes when being started next time, and if the loading mark changes, the program of the single chip microcomputer is determined to need to be upgraded.

In the implementation process, the program to be upgraded is stored in the loading area in the main control card, so that whether the program of the single chip microcomputer needs to be upgraded can be sensed in real time through the main control card, and the processing resource of the single chip microcomputer does not need to be occupied.

On the basis of the above embodiment, in order to ensure the reliability of program upgrade of the single chip microcomputer, the main control card may further be provided with a main loading area and a standby loading area, as shown in fig. 3, both the main loading area and the standby loading area may be used for storing a program to be upgraded, and a user may place the program to be upgraded in the main loading area and/or the standby loading area according to a requirement.

When the master control card issues the upgrade flag to the service card, the upgrade flag may be issued according to the loading area where the program to be upgraded is located, for example, if the program to be upgraded in the master loading area is upgraded, the generated upgrade flag may be represented as 01, and if the program to be upgraded in the backup recording area is upgraded, the generated upgrade flag may be represented as 02, that is, the upgrade flag generated in this case may also represent the identifier of the loading area in the master control card.

After the service card obtains the upgrade flag, the loading flag is updated to the upgrade flag, so that the loading flag in the service card can be used to represent the flag of the loading area in the main control card. Therefore, when the service card determines that the program of the single chip microcomputer needs to be upgraded, the service card can send an upgrade request carrying a corresponding loading mark to the main control card, after the main control card obtains the upgrade request, the main control card obtains the loading mark from the upgrade request, and then the service card can read the program to be upgraded from the corresponding loading area according to the loading mark and send the program to the service card.

For example, if the load flag is a load flag (e.g. 01) of the main load area, the main control card obtains the program to be upgraded from the main load area, and if the load flag is a load flag (02) of the standby load area, the main control card reads the program to be upgraded from the standby load area.

In the implementation process, the main control card is provided with a main loading area and a standby loading area, so that the business card acquires the corresponding program to be upgraded from the loading area corresponding to the main control card by sending an upgrading request to the main control card, and the upgrading reliability of the single chip microcomputer can be ensured.

In other embodiments, in order to ensure that the single chip microcomputer can operate, the main loading area of the main control card may be configured to be dedicated for storing the current program to be upgraded, and the standby loading area is configured to store the program to be upgraded which is updated last time, that is, the historical program to be upgraded. Therefore, the historical program to be upgraded can be acquired from the standby loading area to operate, so that the single chip microcomputer can operate the program to be upgraded in the standby loading area, and the normal operation of the single chip microcomputer can be ensured. If the single chip microcomputer is upgraded successfully from the program to be upgraded in the main loading area, the current program to be upgraded in the main loading area can be stored in the standby loading area, and the historical program to be upgraded in the standby loading area is deleted, so that the subsequent program to be upgraded can be stored in the main loading area during subsequent upgrading, and the single chip microcomputer can preferentially acquire the program to be upgraded in the main loading area for upgrading.

On the basis of the above embodiment, in order to ensure the upgrade reliability, the service card may also start the timer when sending an upgrade request to the main control card, and if it is determined that the program upgrade of the single chip microcomputer fails after a preset time period, acquire the program to be upgraded from another loading area of the main control card to upgrade.

For example, the upgrade request sent by the service card to the main control card carries a loading flag (e.g. 01) of the main loading area of the main control card, the main control card reads the program to be upgraded from the main loading area and sends the program to the service card, and after the timer reaches a preset time, if the single chip has not received the program to be upgraded sent by the main control card, or if the single chip fails to operate the program to be upgraded, the upgrade failure is indicated. At this time, the service card may send a upgrade request to the main control card, and the load tag carried in the upgrade request is the load tag (e.g. 02) of the standby load area of the main control card, and then the main control card reads the program to be upgraded from the standby load area and sends the program to the service card.

If the service card finishes receiving the program to be upgraded before the preset time length is reached, or the singlechip successfully runs the program to be upgraded, the upgrading is successful, at the moment, the service card can renew the current loading mark (01) of the singlechip into the initial loading mark (such as 00) and delete the timer. When the upgrade fails, the current loading mark can be automatically updated to the loading mark (such as 02) of the standby loading area of the main control card, meanwhile, the program to be upgraded received before is cleared, and then an upgrade request is sent to the main control card; or, before sending the upgrade request to the main control card, the service card may feed back prompt information indicating that the upgrade fails to the main control card, after receiving the prompt information, the main control card may generate a upgrade flag (e.g., 02) based on the program to be upgraded in the standby loading area, send the upgrade flag to the service card, then the service card updates the current loading flag (01) to the upgrade flag (02), and send the upgrade request to the main control card, where the upgrade request carries the load flag (02) in the standby loading area.

In some embodiments, the main control card may further include a plurality of loading areas, not only the main and standby loading areas, where the plurality of loading areas may be used to store the programs to be upgraded respectively, or store the programs to be upgraded at different times, so as to ensure that when the single chip microcomputer fails to obtain the programs to be upgraded from one loading area during the upgrade process, the programs to be upgraded may also be obtained from other plurality of standby loading areas for upgrade, thereby ensuring the upgrade reliability of the single chip microcomputer.

Referring to fig. 4, fig. 4 is a flowchart of another chip program upgrading method provided in this embodiment of the present application, where the method is applied to a main control card in a communication device, and the method includes the following steps:

step S210: and receiving an upgrading request sent by the service card.

The upgrade request may be sent by the service card when the program of the single chip microcomputer needs to be upgraded.

Step S220: and reading a program to be upgraded from a loading area of the main control card according to the upgrading request.

The loading area on the main control card is used for storing a program to be upgraded for upgrading the single chip microcomputer, and after receiving an upgrading request sent by the service card, the main control card reads the program to be upgraded from the loading area and sends the program to be upgraded to the service card, so that the service card can directly run the program to be upgraded to upgrade the program of the single chip microcomputer.

Step S230: and sending the program to be upgraded to the service card so that the service card loads the program to be upgraded to an operation area of a single chip microcomputer of the service card for operation, so as to upgrade the program of the single chip microcomputer, wherein the operation area is used for storing the current operation program.

In some embodiments, the main control card includes a main loading area and a standby loading area, and the upgrade request carries a corresponding loading tag representing the loading area, so that after receiving the upgrade request, the main control card obtains a loading tag from the upgrade request, reads the program to be upgraded from the main loading area and sends the program to be upgraded to the service card if the loading tag is the loading tag of the main loading area, and reads the program to be upgraded from the standby loading area and sends the program to the service card if the loading tag is the loading tag of the standby loading area.

In some embodiments, since the loading area of the main control card is used for storing the program to be upgraded, only the main control card can sense whether the program of the single chip microcomputer needs to be upgraded, and when the main control card detects that the program to be upgraded in the loading area is updated, the main control card sends corresponding prompt information to the service card, so that after receiving the prompt information, the service card can determine that the program of the single chip microcomputer needs to be upgraded, and the service card can send an upgrade request to the main control card when the service card is started next time (if the current service card is started and the operation area is operated, the program to be upgraded cannot be directly acquired to cover the operation area, so that when the next service card is started, the operation area does not acquire the program to be upgraded from the main control card before operation.

It should be noted that, for convenience and brevity of description, the specific working procedure of this embodiment may refer to the corresponding procedure in the foregoing method embodiment, and the description is not repeated here.

An embodiment of the present application further provides a schematic structural diagram (as shown in fig. 1) of a communication device, where the communication device includes a master card and a service card.

The service card is used for sending an upgrading request to the main control card when the program of the single chip microcomputer is determined to be upgraded;

the main control card is used for acquiring a program to be upgraded from a loading area of the main control card according to the upgrading request and sending the program to be upgraded to the service card;

the service card is also used for loading the program to be upgraded into an operation area of the single chip microcomputer to operate so as to upgrade the program of the single chip microcomputer, and the operation area is used for storing the current operation program.

It should be noted that, for convenience and brevity of description, the specific working process of the above-described apparatus may refer to the corresponding process in the foregoing method embodiment, and the description is not repeated here.

Referring to fig. 5, fig. 5 is a block diagram of a chip program upgrading apparatus 200 according to an embodiment of the present disclosure, where the apparatus 200 may be a module, a program segment, or a code on an electronic device. It should be understood that the apparatus 200 corresponds to the above-mentioned embodiment of the method of fig. 2, and can perform various steps related to the embodiment of the method of fig. 2, and the specific functions of the apparatus 200 can be referred to the above description, and the detailed description is appropriately omitted here to avoid redundancy. The apparatus 200 comprises:

the upgrade program obtaining module 210 is configured to obtain a program to be upgraded from a loading area of the main control card when it is determined that the program of the single chip microcomputer needs to be upgraded;

the upgrading module 220 is configured to load the program to be upgraded into an operation area of the single chip microcomputer and operate the program, so as to upgrade the program of the single chip microcomputer, where the operation area is used to store a current operation program.

Optionally, the upgrade program obtaining module 210 is configured to determine whether the loading flag of the single chip microcomputer indicates that upgrading is required, and if so, determine that the program of the single chip microcomputer needs to be upgraded.

Optionally, the upgrade program obtaining module 210 is configured to receive an upgrade flag sent by the master control card, where the upgrade flag is generated when the master control card determines that the single chip microcomputer needs to be upgraded; and updating the loading mark in the singlechip according to the upgrading mark.

Optionally, the upgrade program obtaining module 210 is configured to send an upgrade request carrying a corresponding loading flag to the main control card, so that the main control card reads a program to be upgraded from a corresponding loading area according to the loading flag and sends the program to the service card, where the loading flag is used to represent a flag of the loading area in the main control card.

Optionally, the upgrade program obtaining module 210 is configured to obtain a program to be upgraded from another loading area of the main control card for upgrading if it is determined that the program upgrade of the single chip microcomputer fails after a preset time period.

Referring to fig. 6, fig. 6 is a block diagram of another chip program upgrading apparatus 300 according to an embodiment of the present disclosure, where the apparatus 300 may be a module, a program segment, or a code on an electronic device. It should be understood that the apparatus 300 corresponds to the above-mentioned embodiment of the method of fig. 4, and can perform various steps related to the embodiment of the method of fig. 4, and the specific functions of the apparatus 300 can be referred to the above description, and the detailed description is appropriately omitted here to avoid redundancy. The apparatus 300 comprises:

a request receiving module 310, configured to receive an upgrade request sent by the service card;

an upgrade program reading module 320, configured to read a program to be upgraded from a loading area of the main control card according to the upgrade request;

an upgrade program sending module 330, configured to send a program to be upgraded to the service card, so that the service card loads the program to be upgraded into an operation area of the single chip microcomputer to operate, so as to upgrade the program of the single chip microcomputer, where the operation area is used to store a current operation program.

Optionally, the main control card includes a main loading area and a standby loading area, the upgrade request carries a corresponding loading mark representing the loading area, and the upgrade program reading module 320 is configured to obtain the loading mark from the upgrade request; if the loading mark is the loading mark of the main loading area, reading a program to be upgraded from the main loading area; and if the loading mark is the loading mark of the standby loading area, reading the program to be upgraded from the standby loading area.

Optionally, the apparatus 300 further comprises:

and the information sending module is used for sending corresponding prompt information to the service card when detecting that the program to be upgraded in the loading area of the main control card is updated.

It should be noted that, for the convenience and brevity of description, the specific working procedure of the above-described apparatus may refer to the corresponding procedure in the foregoing method embodiment, and the description is not repeated herein.

Embodiments of the present application provide a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the method processes performed by an electronic device in the method embodiments shown in fig. 2 or fig. 4.

The present embodiments disclose a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the methods provided by the above-described method embodiments, for example, comprising: when the program of the single chip microcomputer is determined to be required to be upgraded, acquiring the program to be upgraded from a loading area of the main control card; and loading the program to be upgraded into an operation area of the single chip microcomputer to operate so as to upgrade the program of the single chip microcomputer, wherein the operation area is used for storing the current operation program.

To sum up, the embodiments of the present application provide a chip program upgrading method, a communication device, and a computer-readable storage medium, in which a program to be upgraded is stored in a loading area of a main control card instead of a loading area of a single chip, so that the device cost can be saved without adding a storage medium to a service card and increasing the storage space of the single chip, and since the single chip is not provided with a loading area, more storage spaces can be provided for an operation area of the single chip, so that operation image files with more functions extended by the service card can be stored in the operation area for operation, thereby facilitating the function extension of the service card. Therefore, the method can give consideration to both the equipment cost and the function expansion of the service card.

In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.

In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.

The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种在线升级程序的方法和电子设备

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!