CN115695397A - Communication method, device, equipment and medium based on JSON file - Google Patents

Communication method, device, equipment and medium based on JSON file Download PDF

Info

Publication number
CN115695397A
CN115695397A CN202211309982.3A CN202211309982A CN115695397A CN 115695397 A CN115695397 A CN 115695397A CN 202211309982 A CN202211309982 A CN 202211309982A CN 115695397 A CN115695397 A CN 115695397A
Authority
CN
China
Prior art keywords
target
string
identifier
json file
option
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211309982.3A
Other languages
Chinese (zh)
Inventor
欧阳育星
鲁碧兰
胡远明
秦晓宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nettrix Information Industry Beijing Co Ltd
Original Assignee
Nettrix Information Industry Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nettrix Information Industry Beijing Co Ltd filed Critical Nettrix Information Industry Beijing Co Ltd
Priority to CN202211309982.3A priority Critical patent/CN115695397A/en
Publication of CN115695397A publication Critical patent/CN115695397A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a communication method, a device, equipment and a medium based on JSON files, comprising the following steps: after detecting that the BIOS system meets JSON file construction conditions, acquiring target identifications corresponding to target options in a target setting page in real time; according to the target identification corresponding to each target option, acquiring a target string matched with each target identification in a preset data information space; and constructing a target JSON file matched with the target setting page according to the target identification and the target word string corresponding to each target option, and sending the target JSON file to the BMC to realize communication with the BMC. The technical scheme of the embodiment of the invention provides a convenient mode for editing option information in a BIOS system, thereby greatly improving the convenience of man-machine interaction.

Description

Communication method, device, equipment and medium based on JSON file
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a communication method, apparatus, device, and medium based on JSON files.
Background
A Basic Input Output System (BIOS) is a boot program deployed on a Read-Only Memory (ROM) chip of a motherboard. A Baseboard Management Controller (BMC) is a basic core function subsystem of a server, and is responsible for core functions of the server, such as hardware state Management, operating system Management, health state Management, and power consumption Management. When the BIOS communicates with the BMC, a Redfish protocol is generally used for information interaction, that is, a JS Object brief (JSON) file is used for data submission and acquisition.
When the existing BIOS constructs the JSON file, the JSON file is generally created based on an identifier (namely MapStringId) corresponding to option information in a Setup interface, and the created JSON file is pushed to the BMC.
However, in the existing JSON file construction mode, when a user remotely views option information from a BMC through a client, a mapping relationship between different identifiers maptrigldd and actual option information (for example, maptrigldd "SETUP001" corresponds to option "administeror pass") needs to be determined, so that the viewing process is complicated, and the JSON file construction method is not friendly to human-computer interaction; secondly, when the user wants to remotely modify the option information through the client, there is also a case of incorrect modification, resulting in a risk of operating errors of the device.
Disclosure of Invention
The invention provides a communication method, a device, equipment and a medium based on a JSON file, which are convenient for a user to edit option information in a BIOS system through a client and greatly improve the convenience of man-machine interaction.
According to an aspect of the present invention, a communication method based on JSON file is provided, which is applied to a basic input output system BIOS, and includes:
after detecting that the BIOS system meets JSON file construction conditions, acquiring target identifications corresponding to target options in a target setting page in real time;
according to the target identification corresponding to each target option, acquiring a target string matched with each target identification in a preset data information space;
the data information space is pre-stored with the mapping relation between original marks corresponding to all setting options in the BIOS system and original strings;
and constructing a target JSON file matched with the target setting page according to the target identification and the target string corresponding to each target option, and sending the target JSON file to a Baseboard Management Controller (BMC) so as to realize communication with the BMC.
Optionally, obtaining, in a preset data information space, a target string matched with each target identifier according to the target identifier corresponding to each target option, where the obtaining includes:
sequentially acquiring a target identifier from target identifiers corresponding to all target options as a current processing identifier;
judging whether a current processing identifier exists in a pre-constructed identifier array, and if not, writing the current processing identifier into the identifier array;
judging whether an original identifier consistent with the current processing identifier exists in the data information space;
if yes, taking the original character string corresponding to the original identification as a target character string matched with the current processing identification;
and returning to execute the operation of sequentially acquiring one target identifier as the current processing identifier from the target identifiers corresponding to all the target options until the processing of all the target identifiers is completed.
Optionally, after determining whether an original identifier that is consistent with the current processing identifier exists in the data information space, the method further includes: if not, returning to execute the operation of sequentially acquiring one target identifier as the current processing identifier in the target identifiers corresponding to all the target options until the processing of all the target identifiers is completed.
Optionally, constructing a target JSON file matched with the target setting page according to the target identifier and the target string corresponding to each target option, where the method includes:
judging whether the target character string corresponding to each target option belongs to a repeated character string or not;
if yes, updating the target string to obtain an updated target string;
and constructing a target JSON file matched with the target setting page according to the target word string corresponding to each target option.
Optionally, after detecting that the BIOS system satisfies the JSON file construction condition, the method further includes:
creating a string array for storing repeated strings;
determining at least one repeated string according to the mapping relation between all original identifications and original strings stored in the data information space, and writing each repeated string into the string array;
judging whether the target character string corresponding to each target option belongs to the repeated character string or not, wherein the judgment comprises the following steps:
and comparing the target character string corresponding to each target option with each repeated character string in the character string array, and judging whether the target character string belongs to the repeated character string according to the comparison result.
Optionally, updating the target string to obtain an updated target string, where the updating includes:
and combining the target identification with the target character string to obtain the updated target character string.
According to another aspect of the present invention, there is provided a JSON file-based communication device for use in a basic input output system BIOS, the device comprising:
the identification acquisition module is used for acquiring target identifications corresponding to target options in a target setting page in real time after detecting that the BIOS meets JSON file construction conditions;
the string acquiring module is used for acquiring target strings matched with the target identifications in a preset data information space according to the target identifications corresponding to the target options;
the data information space is pre-stored with the mapping relation between original marks corresponding to all setting options in the BIOS system and original strings;
and the file construction module is used for constructing a target JSON file matched with the target setting page according to the target identification and the target string corresponding to each target option, and sending the target JSON file to a Baseboard Management Controller (BMC) so as to realize communication with the BMC.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the JSON file based communication method according to any one embodiment of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the JSON file based communication method according to any one of the embodiments of the present invention when executed.
According to another aspect of the present invention, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the JSON file based communication method according to any embodiment of the present invention.
According to the technical scheme provided by the embodiment of the invention, after the fact that a BIOS system meets JSON file construction conditions is detected, the target identification corresponding to each target option in a target setting page is obtained in real time, the target string matched with each target identification is obtained in a preset data information space according to the target identification corresponding to each target option, the target JSON file matched with the target setting page is constructed according to the target identification corresponding to each target option and the target string, and the target JSON file is sent to a BMC, so that the technical means of communication with the BMC is realized, a convenient and fast mode for editing option information in the BIOS system is provided, convenience of man-machine interaction is greatly increased, accuracy of the target string obtaining result is guaranteed, target identification omission in the processing process is avoided, processing efficiency of the target identification is improved, whether the target string belongs to a repeated string is quickly determined, processing efficiency of the target string is improved, the construction efficiency of a subsequent JSON file is improved, uniqueness of the target string is guaranteed, the condition that option setting is modified is avoided, updating time of the target string is saved, and updating efficiency of the target string is improved.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a JSON file-based communication method according to an embodiment of the present invention;
fig. 2 is a flowchart of another JSON file-based communication method provided in an embodiment of the present invention;
FIG. 3 is a flow chart of another JSON file-based communication method provided according to an embodiment of the invention;
fig. 4 is a schematic structural diagram of a communication device based on a JSON file according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the JSON file-based communication method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of a JSON file-based communication method according to an embodiment of the present invention, where the present embodiment is applicable to a case where a BIOS system communicates with a BMC based on a JSON file, and the method may be executed by a JSON file-based communication device, where the JSON file-based communication device may be implemented in a hardware and/or software manner, and the JSON file-based communication device may be configured in a BIOS system of an electronic device. As shown in fig. 1, the method includes:
and step 110, after detecting that the BIOS system meets the JSON file construction condition, acquiring a target identifier corresponding to each target option in a target setting page in real time.
In this embodiment, the BIOS system may be a set of programs that are fixed on a ROM chip on a motherboard in a computer, and the system stores the most important basic input and output programs of the computer, a post-power-on self-test program, a system self-boot program, and the like. Optionally, after the electronic device is powered on, if it is detected that the BIOS system has a communication requirement with the BMC and configuration information before the BIOS system communicates is completely deployed, it may be determined that the BIOS system meets the JSON file construction condition.
In this step, if it is detected that the BIOS system satisfies the JSON file construction condition, a target setting page of the BIOS system may be opened, and a target identifier corresponding to each target option in the page may be obtained in real time. Specifically, the target setting page may be a Setup page related to communication requirements in the BIOS system, and the page may include a plurality of setting options (i.e., target options) related to communication.
In a specific embodiment, after the target setting page is opened, a mapping identity (maptrigld) of each target option may be used as a target identifier corresponding to the target option. Wherein each option on the Setup page has a unique MapStringID, and the MapStringID of different options is different.
Step 120, according to the target identifier corresponding to each target option, acquiring a target string matched with each target identifier in a preset data information space; the data information space prestores the mapping relation between original identifications corresponding to all setting options in the BIOS system and original strings.
In this embodiment, before it is detected that the BIOS system satisfies the JSON file construction condition, optionally, the data information space NameSpace corresponding to the BIOS system may be established according to all setting options deployed in the BIOS system. Specifically, the NameSpace may be constructed according to a mapping relationship between the original identifier (i.e., maptrigid) and the original string (i.e., unistring) corresponding to each setting option.
The original string Unistring may be character information that can be presented on the Setup page by the setting option.
In this step, after the target identifiers of the target options in the target setting page are obtained, the target word strings matched with the target identifiers may be determined according to the mapping relationship between the original identifiers and the original word strings stored in the data information space. Specifically, an original identifier consistent with the target identifier may be obtained in the data information space, and an original string corresponding to the original identifier may be used as the target string corresponding to the target identifier.
Step 130, according to the target identification and the target string corresponding to each target option, constructing a target JSON file matched with the target setting page, and sending the target JSON file to a Baseboard Management Controller (BMC) so as to realize communication with the BMC.
In this step, optionally, after the target word strings corresponding to all the target options are acquired, each target word string, or each target identifier and each target word string may be written into the target JSON file matched with the target setup page, and the target JSON file is sent to the BMC, so that the BMC submits and acquires data according to the target JSON file.
In this embodiment, since the target word string can reflect the character information of the target option, and the JSON file is constructed according to the target word string corresponding to the target option, compared with a method in the prior art in which the JSON file is constructed only according to the target identifier, a user can intuitively obtain the option information in the BIOS according to the JSON file, so that the user can modify the option information through the client, the situation of mistaken modification is avoided, and the convenience of human-computer interaction is greatly increased.
According to the technical scheme provided by the embodiment of the invention, after the BIOS system is detected to meet the JSON file construction condition, the target identification corresponding to each target option in the target setting page is obtained in real time, the target string matched with each target identification is obtained in the preset data information space according to the target identification corresponding to each target option, the target JSON file matched with the target setting page is constructed according to the target identification corresponding to each target option and the target string, and the target JSON file is sent to the BMC, so that the technical means of communication with the BMC is realized, a convenient and fast mode for editing the option information in the BIOS system is provided, and the convenience of man-machine interaction is greatly improved.
On the basis of the above embodiment, after the target JSON file is sent to the BMC to implement communication with the BMC, if it is detected that the setting option in the BIOS system is updated, the mapping relationship between the original identifier and the original string corresponding to the update option may be stored in the data information space.
Fig. 2 is a flowchart of another communication method based on JSON files according to an embodiment of the present invention, and as shown in fig. 2, the method includes:
and step 210, after detecting that the BIOS system meets the JSON file construction condition, acquiring a target identifier corresponding to each target option in a target setting page in real time.
And step 220, sequentially acquiring one target identifier from the target identifiers corresponding to all the target options as a current processing identifier.
Step 230, determining whether a current processing identifier exists in the identifier array constructed in advance, if yes, executing step 240, and if not, executing step 250.
In this embodiment, optionally, after detecting that the BIOS system satisfies the JSON file construction condition, an identifier array for storing the target identifier may be established. Because a plurality of repeated target options may exist in the target setting page, after the current processing identifier is obtained, whether the current processing identifier exists in the identifier array can be judged.
And 240, judging whether an original mark consistent with the current processing mark exists in the data information space, if so, executing the step 260, otherwise, returning to execute the operation of the step 220 until the processing of all target marks is finished.
In this step, optionally, if the current processing identifier exists in the identifier array, it may be determined that the current processing identifier does not appear for the first time, and it is determined whether an original identifier consistent with the current processing identifier exists in the data information space.
In this embodiment, after the target identifier is determined through the data information space, the determination result may be labeled, so that after repeated target identifiers occur, the determination result of the target identifier in the data information space may be directly obtained according to the labeling result, thereby improving the processing efficiency of the target identifier.
And step 250, writing the current processing identifier into an identifier array.
In this step, if the current processing identifier does not exist in the identifier array, the current processing identifier may be considered to be the first occurrence, and the current processing identifier is written into the identifier array, and then the operation of determining whether the original identifier consistent with the current processing identifier exists in the data information space in step 240 is performed.
And step 260, taking the original string corresponding to the original identifier as the target string matched with the current processing identifier.
In this embodiment, if an original identifier consistent with the current processing identifier exists in the data information space, the original string corresponding to the original identifier may be used as the target string matched with the current processing identifier; otherwise, if the original identifier consistent with the current processing identifier does not exist in the data information space, the current processing identifier may be considered to be an invalid identifier, and the operation of returning and executing the target identifiers corresponding to all the target options and sequentially acquiring one target identifier as the current processing identifier is performed.
The method has the advantages that on one hand, the accuracy of the target string obtaining result can be ensured by processing each target mark in sequence; on the other hand, target identification is written into the identification array, omission of the target identification in the processing process can be avoided, and the processing efficiency of the target identification can be improved after repeated target identification occurs.
Step 270, determining whether to complete the processing of all the target identifiers, if yes, executing step 280, and if not, returning to execute the operation of step 220 until the processing of all the target identifiers is completed.
Step 280, according to the target identification and the target string corresponding to each target option, constructing a target JSON file matched with the target setting page, and sending the target JSON file to a Baseboard Management Controller (BMC) so as to realize communication with the BMC.
According to the technical scheme provided by the embodiment of the invention, after the BIOS system is detected to meet the JSON file construction condition, the target identification corresponding to each target option in the target setting page is obtained in real time, one target identification is sequentially obtained from the target identifications corresponding to all the target options as the current processing identification, whether the current processing identification exists in the pre-constructed identification array is judged, if not, the current processing identification is written into the identification array, whether the original identification consistent with the current processing identification exists in the data information space is judged, if so, the original character string corresponding to the original identification is used as the target character string matched with the current processing identification, the target JSON file matched with the target setting page is constructed according to the target identification and the target character string corresponding to each target option, and finally, the target JSON file is sent to the BMC to realize the communication technical means, so that a convenient and fast mode for editing option information in the BIOS system is provided, and the convenience of man-machine interaction is greatly improved.
Fig. 3 is a flowchart of another communication method based on JSON files according to an embodiment of the present invention, and as shown in fig. 3, the method includes:
and 310, after detecting that the BIOS system meets the JSON file construction condition, creating a string array for storing repeated strings.
Step 320, determining at least one repeated string according to the mapping relationship between all the original identifiers and the original strings stored in the data information space, and writing each repeated string into the string array.
In this step, the original strings stored in the data information space may be compared, and the original string with the occurrence number greater than one may be regarded as a repeated string, and then the repeated string may be written into the string array.
And step 330, acquiring a target identifier corresponding to each target option in the target setting page in real time.
Step 340, according to the target identifier corresponding to each target option, obtaining the target string matched with each target identifier in a preset data information space.
Step 350, determining whether the target string corresponding to each target option belongs to a repeated string, if yes, executing step 360, and if not, executing step 370.
In an implementation manner of this embodiment, determining whether the target string corresponding to each target option belongs to a duplicate string includes: and comparing the target character string corresponding to each target option with each repeated character string in the character string array, and judging whether the target character string belongs to the repeated character string according to the comparison result.
In this step, the target string corresponding to the target option may be compared with each repeated string in the string array, and if the string array includes a string identical to the target string, the target string may be considered to belong to the repeated string.
The arrangement has the advantages that whether the target word string belongs to the repeated word string can be quickly determined by constructing the word string array in advance and obtaining the comparison result of the target word string and each word string in the word string array, so that the processing efficiency of the target word string and the construction efficiency of the subsequent JSON file are improved.
And step 360, updating the target character string to obtain an updated target character string.
In this embodiment, optionally, if the target string belongs to a repeated string, the target string may be updated (for example, characters are added, changed, or deleted, etc.), so as to obtain an updated target string.
The setting method has the advantages that the uniqueness of the target character string can be guaranteed, a user can edit related setting options conveniently according to the target character string, and the situation that the setting options are modified by mistake is avoided.
In an implementation manner of this embodiment, updating the target string to obtain an updated target string includes: and combining the target identification with the target character string to obtain the updated target character string.
The setting has the advantages that the updating time of the target character string can be saved, and the updating efficiency of the target character string is improved.
Step 370, using the target string currently corresponding to the target option as the finally used target string.
And 380, constructing a target JSON file matched with the target setting page according to the target string corresponding to each target option.
And 390, sending the target JSON file to a Baseboard Management Controller (BMC) to realize communication with the BMC.
According to the technical scheme provided by the embodiment of the invention, after a BIOS system is detected to meet JSON file construction conditions, a string array for storing repeated strings is created, at least one repeated string is determined according to the mapping relation between all original identifications and the original strings stored in a data information space, each repeated string is written into the string array, a target identification corresponding to each target option in a target setting page is obtained in real time, a target string matched with each target identification is obtained in a preset data information space according to the target identification corresponding to each target option, whether the target string corresponding to each target option belongs to the repeated string is judged, if yes, the target string is updated to obtain an updated target string, a target JSON file matched with the target setting page is constructed according to the target string corresponding to each target option, and the target JSON file is sent to a BMC to realize a technical means for communicating with the BMC, so that a convenient and fast mode for editing option information in the BIOS system is provided, and convenience of man-machine interaction is greatly improved.
Fig. 4 is a schematic structural diagram of a communication device based on JSON files according to an embodiment of the present invention, where the communication device is applied to a basic input output system BIOS, and as shown in fig. 4, the communication device includes: an identity obtaining module 410, a string obtaining module 420 and a file constructing module 430.
The identifier obtaining module 410 is configured to obtain, in real time, a target identifier corresponding to each target option in a target setting page after detecting that the BIOS system satisfies a JSON file building condition;
a string obtaining module 420, configured to obtain, according to a target identifier corresponding to each target option, a target string matching each target identifier in a preset data information space;
the data information space is pre-stored with the mapping relation between original marks corresponding to all setting options in the BIOS system and original strings;
and the file construction module 430 is configured to construct a target JSON file matched with the target setup page according to the target identifier and the target string corresponding to each target option, and send the target JSON file to a baseboard management controller BMC, so as to implement communication with the BMC.
According to the technical scheme provided by the embodiment of the invention, after the BIOS system is detected to meet the JSON file construction condition, the target identification corresponding to each target option in the target setting page is obtained in real time, the target character string matched with each target identification is obtained in the preset data information space according to the target identification corresponding to each target option, the target JSON file matched with the target setting page is constructed according to the target identification corresponding to each target option and the target character string, and the target JSON file is sent to the BMC, so that the technical means of communication with the BMC is realized, a convenient and fast mode for editing the option information in the BIOS system is provided, and the convenience of man-machine interaction is greatly improved.
On the basis of the above embodiment, the identifier obtaining module 410 includes:
a string array creation unit configured to create a string array for storing a repetitive string;
and the repeated string determining unit is used for determining at least one repeated string according to the mapping relation between all the original identifications and the original strings stored in the data information space, and writing each repeated string into the string array.
The string obtaining module 420 includes:
a current identifier obtaining unit, configured to sequentially obtain one target identifier as a current processing identifier from the target identifiers corresponding to all the target options;
the identification array processing unit is used for judging whether a current processing identification exists in a pre-constructed identification array or not, and if not, writing the current processing identification into the identification array;
the identification judgment unit is used for judging whether an original identification consistent with the current processing identification exists in the data information space;
if yes, taking the original character string corresponding to the original identification as a target character string matched with the current processing identification; if not, returning to execute the operation of sequentially acquiring one target identifier as the current processing identifier in the target identifiers corresponding to all the target options until the processing of all the target identifiers is completed.
The file construction module 430 includes:
a string judgment unit, configured to judge whether a target string corresponding to each target option belongs to a repeated string; if yes, updating the target character string to obtain an updated target character string;
the JSON file construction unit is used for constructing a target JSON file matched with the target setting page according to the target word string corresponding to each target option;
the word string comparison unit is used for comparing the target word string corresponding to each target option with each repeated word string in the word string array and judging whether the target word string belongs to the repeated word string according to the comparison result;
and the string combination unit is used for combining the target mark with the target string to obtain the updated target string.
The device can execute the methods provided by all the embodiments of the invention, and has corresponding functional modules and beneficial effects for executing the methods. For technical details which are not described in detail in the embodiments of the present invention, reference may be made to the methods provided in all the embodiments of the present invention described above.
FIG. 5 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to the bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as a JSON file-based communication method.
In some embodiments, the JSON file-based communication method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the JSON file based communication method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the JSON file-based communication method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A communication method based on JSON files is applied to a Basic Input Output System (BIOS), and comprises the following steps:
after detecting that the BIOS system meets JSON file construction conditions, acquiring target identifications corresponding to target options in a target setting page in real time;
according to target identifications corresponding to the target options, acquiring target character strings matched with the target identifications in a preset data information space;
the data information space is pre-stored with the mapping relation between original marks corresponding to all setting options in the BIOS system and original strings;
and constructing a target JSON file matched with the target setting page according to the target identification and the target string corresponding to each target option, and sending the target JSON file to a Baseboard Management Controller (BMC) so as to realize communication with the BMC.
2. The method of claim 1, wherein obtaining, in a preset data information space, a target string matching each target identifier according to the target identifier corresponding to each target option comprises:
sequentially acquiring a target identifier from the target identifiers corresponding to all the target options as a current processing identifier;
judging whether a current processing identifier exists in a pre-constructed identifier array, and if not, writing the current processing identifier into the identifier array;
judging whether an original identifier consistent with the current processing identifier exists in the data information space;
if yes, taking the original character string corresponding to the original identification as a target character string matched with the current processing identification;
and returning to execute the operation of sequentially acquiring one target identifier as the current processing identifier from the target identifiers corresponding to all the target options until the processing of all the target identifiers is completed.
3. The method of claim 2, after determining whether an original tag consistent with a current process tag exists in the data information space, further comprising:
if not, returning to execute the operation of sequentially acquiring one target identifier as the current processing identifier in the target identifiers corresponding to all the target options until the processing of all the target identifiers is completed.
4. The method of claim 1, wherein constructing a target JSON file matched with the target setup page according to the target identifier and the target string corresponding to each target option comprises:
judging whether the target character string corresponding to each target option belongs to a repeated character string or not;
if yes, updating the target character string to obtain an updated target character string;
and constructing a target JSON file matched with the target setting page according to the target word string corresponding to each target option.
5. The method of claim 4, after detecting that the BIOS system satisfies the JSON file building condition, further comprising:
creating a string array for storing repeated strings;
determining at least one repeated string according to the mapping relation between all original identifications and original strings stored in a data information space, and writing each repeated string into the string array;
judging whether the target string corresponding to each target option belongs to the repeated string, including:
and comparing the target character string corresponding to each target option with each repeated character string in the character string array, and judging whether the target character string belongs to the repeated character string according to the comparison result.
6. The method of claim 4, wherein updating the target string to obtain an updated target string comprises:
and combining the target identification with the target character string to obtain the updated target character string.
7. A communication device based on JSON file is applied to basic input output system BIOS, comprising:
the identification acquisition module is used for acquiring target identifications corresponding to target options in a target setting page in real time after detecting that the BIOS meets JSON file construction conditions;
the string acquiring module is used for acquiring target strings matched with the target identifications in a preset data information space according to the target identifications corresponding to the target options;
the data information space is pre-stored with the mapping relation between original identifications corresponding to all setting options in the BIOS system and original strings;
and the file construction module is used for constructing a target JSON file matched with the target setting page according to the target identification and the target string corresponding to each target option, and sending the target JSON file to a Baseboard Management Controller (BMC) so as to realize communication with the BMC.
8. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the JSON file based communication method of any one of claims 1 to 6.
9. A computer-readable storage medium storing computer instructions for causing a processor to implement the JSON file-based communication method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that the computer program product comprises a computer program which, when executed by a processor, implements the JSON file based communication method according to any one of claims 1-6.
CN202211309982.3A 2022-10-25 2022-10-25 Communication method, device, equipment and medium based on JSON file Pending CN115695397A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211309982.3A CN115695397A (en) 2022-10-25 2022-10-25 Communication method, device, equipment and medium based on JSON file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211309982.3A CN115695397A (en) 2022-10-25 2022-10-25 Communication method, device, equipment and medium based on JSON file

Publications (1)

Publication Number Publication Date
CN115695397A true CN115695397A (en) 2023-02-03

Family

ID=85098807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211309982.3A Pending CN115695397A (en) 2022-10-25 2022-10-25 Communication method, device, equipment and medium based on JSON file

Country Status (1)

Country Link
CN (1) CN115695397A (en)

Similar Documents

Publication Publication Date Title
CN112559631B (en) Data processing method and device of distributed graph database and electronic equipment
CN113377809A (en) Data processing method and apparatus, computing device, and medium
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN116009847A (en) Code generation method, device, electronic equipment and storage medium
CN115695397A (en) Communication method, device, equipment and medium based on JSON file
CN115860877A (en) Product marketing method, device, equipment and medium
CN113553415B (en) Question-answer matching method and device and electronic equipment
CN115756322A (en) Data storage method and device, electronic equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN112860811B (en) Method and device for determining data blood relationship, electronic equipment and storage medium
CN113127357B (en) Unit test method, apparatus, device, storage medium, and program product
CN113312050B (en) Content display method, device, equipment and medium
CN112948246B (en) AB test control method, device and equipment of data platform and storage medium
CN116225496A (en) Firmware upgrading method, device and equipment of voltage converter and storage medium
CN115983222A (en) EasyExcel-based file data reading method, device, equipment and medium
CN114416040A (en) Page construction method, device, equipment and storage medium
CN115794131A (en) Method and device for automatically generating thermal deployment program and electronic equipment
CN115686304A (en) Information acquisition method and device, electronic equipment and storage medium
CN113434508A (en) Method and apparatus for storing information
CN116708362A (en) Communication address processing method, device, equipment and storage medium
CN116303071A (en) Interface testing method and device, electronic equipment and storage medium
CN117591196A (en) Default value configuration method, default value configuration device, electronic equipment and storage medium
CN115567624A (en) Message processing method and device, electronic equipment and medium
CN115757275A (en) Asset information management method and device, electronic equipment and storage medium
CN112560462A (en) Method, device, server and medium for generating event extraction service

Legal Events

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