A communication method, device, equipment and medium based on JSON file
By obtaining and constructing the target option identifier and string of the JSON file in real time in the BIOS system, the problem of complex user interaction and mistaken modification in the existing technology is solved, the convenient editing and accurate processing of the BIOS system option information is realized, and the efficiency is improved. Equipment stability and efficiency.
Patent Information
- Application Number
- CN202211309982.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-10-25
AI Technical Summary
When the existing BIOS builds a JSON file and users remotely view and modify option information through the client, there is a risk that the mapping relationship is complex, the human-computer interaction is unfriendly, and it is easy to modify by mistake, resulting in device operation errors.
After detecting that the BIOS system meets the JSON file construction conditions, the target option identifier of the target setting page is obtained in real time, and the matching target string is obtained in the preset data information space, and the target JSON file is constructed and sent to the BMC to realize communication with the BMC. Ensure the convenience and accuracy of option information editing.
It improves the convenience of human-computer interaction, avoids mistaken modification of option information, ensures processing efficiency and JSON file construction efficiency, ensures the uniqueness of the target string, and reduces update time.
Smart Images

Figure CN115695397B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a communication method, device, equipment and medium based on a JSON file. Background Art
[0002] The Basic Input Output System (BIOS) is a boot program deployed on the motherboard's Read-Only Memory (ROM) chip. The Baseboard Management Controller (BMC) is the basic core functional subsystem of the server, responsible for the server's hardware status management, operating system management, health status management, power consumption management and other core functions. When BIOS communicates with BMC, the Redfish protocol is usually used for information exchange, that is, JavaScript Object Notation (JSON) files are used to submit and obtain data.
[0003] When constructing a JSON file, the existing BIOS usually creates the JSON file based on an identifier (ie, MapStringId) corresponding to option information in a Setup interface, and pushes the created JSON file to the BMC.
[0004] However, under the existing JSON file construction method, when the user remotely views option information from the BMC through the client, it is necessary to determine the mapping relationship between different identifiers MapStringId and the actual option information (for example, MapStringId "SETUP001" corresponds to the option "Administrator Password"), which makes the viewing process more complicated and not user-friendly for human-computer interaction. Secondly, when the user wants to remotely modify the option information through the client, there is still the risk of erroneous modification, which leads to the risk of equipment operation errors. Summary of the invention
[0005] The present invention provides a communication method, apparatus, device and medium based on JSON files, which facilitates users to edit option information in a BIOS system through a client, greatly increasing the convenience of human-computer interaction.
[0006] According to one aspect of the present invention, a communication method based on a JSON file is provided, which is applied to a basic input / output system BIOS, and includes:
[0007] After detecting that the BIOS system meets the JSON file building conditions, the target identifier corresponding to each target option in the target setting page is obtained in real time;
[0008] According to the target identifiers corresponding to the target options, in the preset data information space, a target string matching each of the target identifiers is obtained;
[0009] The data information space pre-stores the mapping relationship between the original identifiers and the original strings corresponding to all the setting options in the BIOS system;
[0010] According to the target identifier and the target string corresponding to each of the target options, a target JSON file matching the target setting page is constructed, and the target JSON file is sent to a baseboard management controller BMC to achieve communication with the BMC.
[0011] Optionally, according to the target identifiers corresponding to the target options, in a preset data information space, obtaining a target string matching each of the target identifiers includes:
[0012] Among the target identifiers corresponding to all target options, one target identifier is obtained in turn as the current processing identifier;
[0013] Determine whether the current processing identifier exists in the pre-built identifier array, and if not, write the current processing identifier into the identifier array;
[0014] Determine whether there is an original identifier consistent with the current processing identifier in the data information space;
[0015] If yes, the original string corresponding to the original identifier is used as the target string matched by the current processing identifier;
[0016] Returns the operation of obtaining one target identifier as the current processing identifier in the target identifiers corresponding to all target options in turn until the processing of all target identifiers is completed.
[0017] Optionally, after determining whether there is an original identifier consistent with the current processing identifier in the data information space, it also includes: if not, returning to execute the operation of obtaining one target identifier as the current processing identifier in the target identifiers corresponding to all target options in turn until the processing of all target identifiers is completed.
[0018] Optionally, a target JSON file matching the target setting page is constructed according to the target identifier and target string corresponding to each of the target options, including:
[0019] Determine whether the target string corresponding to each of the target options is a repeated string;
[0020] If yes, then the target string is updated to obtain an updated target string;
[0021] According to the target strings corresponding to the target options, a target JSON file matching the target setting page is constructed.
[0022] Optionally, after detecting that the BIOS system meets the JSON file building conditions, it also includes:
[0023] Create a string array to store repeated strings;
[0024] Determine at least one repeated string according to the mapping relationship between all original identifiers and original strings stored in the data information space, and write each of the repeated strings into the string array;
[0025] Determining whether the target string corresponding to each of the target options is a repeated string includes:
[0026] The target string corresponding to each of the target options is compared with each repeated string in the string array, and whether the target string is a repeated string is determined according to the comparison result.
[0027] Optionally, updating the target string to obtain an updated target string includes:
[0028] The target identifier is combined with the target string to obtain an updated target string.
[0029] According to another aspect of the present invention, a communication device based on a JSON file is provided, which is applied to a basic input / output system BIOS, and the device comprises:
[0030] The identification acquisition module is used to obtain the target identification corresponding to each target option in the target setting page in real time after detecting that the BIOS system meets the JSON file construction conditions;
[0031] A string acquisition module, used to acquire a target string matching each target identifier in a preset data information space according to the target identifier corresponding to each target option;
[0032] The data information space pre-stores the mapping relationship between the original identifiers and the original strings corresponding to all the setting options in the BIOS system;
[0033] The file construction module is used to construct a target JSON file matching the target setting page according to the target identifier and target string corresponding to each target option, and send the target JSON file to the baseboard management controller BMC to achieve communication with the BMC.
[0034] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0035] at least one processor; and
[0036] a memory communicatively connected to the at least one processor; wherein,
[0037] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the JSON file-based communication method described in any embodiment of the present invention.
[0038] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the communication method based on a JSON file described in any embodiment of the present invention when executed.
[0039] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program, and the computer program, when executed by a processor, implements the communication method based on a JSON file as described in any embodiment of the present invention.
[0040] The technical solution provided by the embodiment of the present invention detects that the BIOS system meets the JSON file construction conditions, obtains the target identifier corresponding to each target option in the target setting page in real time, obtains the target string matching each target identifier in the preset data information space according to the target identifier corresponding to each target option, constructs the target JSON file matching the target setting page according to the target identifier and the target string corresponding to each target option, and sends the target JSON file to the BMC to realize the technical means of communicating with the BMC, provides a convenient way to edit option information in the BIOS system, greatly increases the convenience of human-computer interaction, ensures the accuracy of the target string acquisition result, avoids omission of the target identifier during the processing, improves the processing efficiency of the target identifier, quickly determines whether the target string is a repeated string, so as to improve the processing efficiency of the target string and the subsequent JSON file construction efficiency, ensures the uniqueness of the target string, avoids the situation of erroneous modification of the setting options, can save the update time of the target string, and improves the update efficiency of the target string.
[0041] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 is a flow chart of a communication method based on a JSON file provided according to an embodiment of the present invention;
[0044] Figure 2 is a flowchart of another communication method based on a JSON file provided according to an embodiment of the present invention;
[0045] Figure 3 is a flowchart of another communication method based on a JSON file provided according to an embodiment of the present invention;
[0046] Figure 4 is a structural diagram of a communication device based on a JSON file provided according to an embodiment of the present invention;
[0047] Figure 5 It is a structural schematic diagram of an electronic device that implements the communication method based on a JSON file according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0050] Figure 1The flowchart of a communication method based on JSON file provided by an embodiment of the present invention is applicable to the case where the BIOS system communicates with the BMC based on JSON file. The method can be executed by a communication device based on JSON file. The communication device based on JSON file can be implemented in the form of hardware and / or software. The communication device based on JSON file can be configured in the BIOS system of the electronic device. Figure 1 As shown, the method includes:
[0051] Step 110: After detecting that the BIOS system meets the JSON file construction conditions, the target identifier corresponding to each target option in the target setting page is obtained in real time.
[0052] In this embodiment, the BIOS system may be a set of programs solidified 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 self-check program after power-on, and a system self-starting program, etc. Optionally, after the electronic device is powered on, if it is detected that the BIOS system has a communication requirement with the BMC, and all configuration information before the BIOS system communicates is deployed, it can be determined that the BIOS system meets the JSON file construction conditions.
[0053] In this step, if it is detected that the BIOS system meets the JSON file construction conditions, the target setting page of the BIOS system can be opened, and the target identifier corresponding to each target option in the page can be obtained in real time. Specifically, the target setting page can be a Setup page related to communication requirements in the BIOS system, which can include multiple communication-related setting options (i.e., target options).
[0054] In a specific embodiment, after opening the target setting page, the mapping identity (MapStringID) of each target option can be used as the target identifier corresponding to the target option. Wherein, each option on the Setup page has a unique MapStringID, and different options have different MapStringIDs.
[0055] Step 120: According to the target identifier corresponding to each target option, a target string matching each target identifier is obtained in a preset data information space; wherein the data information space pre-stores a mapping relationship between the original identifier and the original string corresponding to all setting options in the BIOS system.
[0056] In this embodiment, before the BIOS system is detected to meet the JSON file construction conditions, optionally, a data information space NameSpace corresponding to the BIOS system can be established according to all the setting options deployed in the BIOS system. Specifically, the NameSpace can be constructed according to the mapping relationship between the original identifier (i.e., MapStringID) and the original string (i.e., Unistring) corresponding to each setting option.
[0057] The original string Unistring may be character information that can be presented on the Setup page of the setting option.
[0058] In this step, after obtaining the target identifier of each target option in the target setting page, the target string corresponding to each target identifier can be determined according to the mapping relationship between the original identifier and the original string stored in the data information space. Specifically, the original identifier consistent with the target identifier can be obtained in the data information space, and the original string corresponding to the original identifier is used as the target string corresponding to the target identifier.
[0059] Step 130: construct a target JSON file matching the target setting 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 to achieve communication with the BMC.
[0060] In this step, optionally, after obtaining the target strings corresponding to all target options, each target string, or each target identifier and target string, can be written into a target JSON file that matches the target setting page, and the target JSON file can be sent to the BMC so that the BMC can submit and obtain data according to the target JSON file.
[0061] In this embodiment, since the target string can reflect the character information of the target option, by constructing a JSON file according to the target string corresponding to the target option, compared with the method of constructing a JSON file only according to the target identifier in the prior art, the user can intuitively obtain the option information in the BIOS system according to the JSON file, which is convenient for the user to modify the option information through the client and avoid erroneous modification, thereby greatly increasing the convenience of human-computer interaction.
[0062] The technical solution provided by the embodiment of the present invention detects that the BIOS system meets the JSON file construction conditions, obtains the target identifier corresponding to each target option in the target setting page in real time, obtains the target string matching each target identifier in the preset data information space according to the target identifier corresponding to each target option, constructs the target JSON file matching the target setting page according to the target identifier and the target string corresponding to each target option, and sends the target JSON file to the BMC to realize the technical means of communicating with the BMC, provides a convenient way to edit option information in the BIOS system, and greatly increases the convenience of human-computer interaction.
[0063] Based on the above embodiment, after the target JSON file is sent to the baseboard management controller BMC to communicate with the BMC, if it is detected that the setting options in the BIOS system are updated, the mapping relationship between the original identifier and the original string corresponding to the updated option can be stored in the data information space.
[0064] Figure 2 A flowchart of another communication method based on a JSON file provided in an embodiment of the present invention, such as Figure 2 As shown, the method includes:
[0065] Step 210: After detecting that the BIOS system meets the JSON file construction conditions, the target identifier corresponding to each target option in the target setting page is obtained in real time.
[0066] Step 220: From the target identifiers corresponding to all target options, one target identifier is obtained in turn as the current processing identifier.
[0067] Step 230 , determine whether the current processing identifier exists in the pre-built identifier array, if so, execute step 240 , if not, execute step 250 .
[0068] In this embodiment, optionally, after detecting that the BIOS system meets the JSON file construction conditions, an identification array for storing target identifications can be established. Since there may be multiple repeated target options in the target setting page, after obtaining the current processing identification, it can be determined whether the current processing identification exists in the identification array.
[0069] Step 240, determine whether there is an original identifier consistent with the current processing identifier in the data information space. If so, execute step 260. If not, return to execute the operation of step 220 until the processing of all target identifiers is completed.
[0070] In this step, optionally, if the current processing identifier exists in the identifier array, it can be considered that the current processing identifier does not appear for the first time, and it is determined whether there is an original identifier consistent with the current processing identifier in the data information space.
[0071] In this embodiment, after the target identifier is judged through the data information space, the judgment result can be marked, so that when a repeated target identifier appears, the judgment result of the target identifier in the data information space can be directly obtained according to the marked result, thereby improving the processing efficiency of the target identifier.
[0072] Step 250: Write the current processing identifier into an identifier array.
[0073] In this step, if the current processing identifier does not exist in the identifier array, it can be considered that the current processing identifier appears for the first time, and the current processing identifier is written into the identifier array, and then the operation of determining whether there is an original identifier consistent with the current processing identifier in the data information space in step 240 is executed.
[0074] Step 260: Use the original string corresponding to the original identifier as the target string for matching the current processing identifier.
[0075] In this embodiment, if there is an original identifier consistent with the current processing identifier in the data information space, the original string corresponding to the original identifier can be used as the target string matching the current processing identifier; conversely, if there is no original identifier consistent with the current processing identifier in the data information space, it can be considered that the current processing identifier may be an invalid identifier, and the operation of executing the target identifiers corresponding to all target options is returned to obtain one target identifier in turn as the current processing identifier.
[0076] The advantage of this setting is that, on the one hand, by processing each target identifier in turn, the accuracy of the target string acquisition result can be guaranteed; on the other hand, by writing the target identifier into the identifier array, omission of target identifiers during the processing process can be avoided, and when repeated target identifiers appear, the processing efficiency of the target identifier can be improved.
[0077] Step 270, determine whether the processing of all target identifiers is completed, if so, execute step 280, if not, return to execute the operation of step 220 until the processing of all target identifiers is completed.
[0078] Step 280: construct a target JSON file matching the target setting 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 to achieve communication with the BMC.
[0079] The technical solution provided by the embodiment of the present invention detects that the BIOS system meets the JSON file construction conditions, obtains the target identifier corresponding to each target option in the target setting page in real time, obtains one target identifier in turn as the current processing identifier among the target identifiers corresponding to all target options, judges whether the current processing identifier exists in the pre-constructed identifier array, if not, writes the current processing identifier into the identifier array, and judges whether there is an original identifier consistent with the current processing identifier in the data information space, if so, uses the original string corresponding to the original identifier as the target string matching the current processing identifier, and constructs a target JSON file matching the target setting page according to the target identifier and the target string corresponding to each target option, and finally sends the target JSON file to the BMC to realize the technical means of communicating with the BMC, providing a convenient way to edit option information in the BIOS system, greatly increasing the convenience of human-computer interaction.
[0080] Figure 3 A flowchart of another communication method based on a JSON file provided in an embodiment of the present invention, such as Figure 3 As shown, the method includes:
[0081] Step 310: After detecting that the BIOS system meets the JSON file construction conditions, create a string array for storing repeated strings.
[0082] Step 320: Determine at least one repeated string according to the mapping relationship between all original identifiers and original strings stored in the data information space, and write each repeated string into the string array.
[0083] In this step, the original strings stored in the data information space can be compared, and the original strings with a number of occurrences greater than one are regarded as repeated strings, and then the repeated strings are written into the string array.
[0084] Step 330: Obtain the target identifier corresponding to each target option in the target setting page in real time.
[0085] Step 340: According to the target identifiers corresponding to the target options, a target string matching each target identifier is obtained in a preset data information space.
[0086] Step 350 , determine whether the target string corresponding to each of the target options is a repeated string, if so, execute step 360 , if not, execute step 370 .
[0087] In one implementation of the present embodiment, determining whether a target string corresponding to each of the target options is a repeated string includes: comparing the target string corresponding to each of the target options with each repeated string in the string array, and determining whether the target string is a repeated string based on the comparison result.
[0088] In this step, the target string corresponding to the target option may be compared with each repeated string in the string array. If there is a string in the string array that is identical to the target string, the target string is considered to be a repeated string.
[0089] The advantage of this setting is that by pre-building a string array and obtaining the comparison results between the target string and each string in the string array, it is possible to quickly determine whether the target string is a repeated string, thereby improving the processing efficiency of the target string and the efficiency of building subsequent JSON files.
[0090] Step 360: Update the target string to obtain an updated target string.
[0091] In this embodiment, optionally, if the target string is a repeated string, the target string may be updated (eg, characters are added, modified, or deleted) to obtain an updated target string.
[0092] The advantage of such a setting is that it can ensure the uniqueness of the target string, making it easier for users to edit related setting options based on the target string and avoiding the situation where the setting options are modified by mistake.
[0093] In one implementation of this embodiment, updating the target string to obtain an updated target string includes: combining the target identifier with the target string to obtain an updated target string.
[0094] The advantage of this setting is that it can save the target string update time and improve the target string update efficiency.
[0095] Step 370: Use the target string currently corresponding to the target option as the target string to be finally used.
[0096] Step 380: construct a target JSON file that matches the target setting page according to the target string corresponding to each of the target options.
[0097] Step 390: Send the target JSON file to a baseboard management controller BMC to achieve communication with the BMC.
[0098] The technical solution provided by the embodiment of the present invention creates a string array for storing repeated strings after detecting that the BIOS system meets the JSON file construction conditions, determines at least one repeated string according to the mapping relationship between all original identifiers and original strings stored in the data information space, and writes each repeated string into the string array, obtains the target identifier corresponding to each target option in the target setting page in real time, obtains the target string matching each target identifier in the preset data information space according to the target identifier corresponding to each target option, judges whether the target string corresponding to each target option belongs to the repeated string, and if so, updates the target string to obtain the updated target string, constructs the target JSON file matching the target setting page according to the target string corresponding to each target option, and sends the target JSON file to the BMC to realize the technical means of communicating with the BMC, thereby providing a convenient way to edit option information in the BIOS system and greatly increasing the convenience of human-computer interaction.
[0099] Figure 4 A schematic diagram of a communication device based on a JSON file provided in an embodiment of the present invention, wherein the device is applied to a basic input / output system BIOS, such as Figure 4 As shown, the device includes: an identification acquisition module 410, a string acquisition module 420 and a file construction module 430.
[0100] The identification acquisition module 410 is used to obtain the target identification corresponding to each target option in the target setting page in real time after detecting that the BIOS system meets the JSON file construction conditions;
[0101] The string acquisition module 420 is used to acquire a target string matching each target identifier in a preset data information space according to the target identifier corresponding to each target option;
[0102] The data information space pre-stores the mapping relationship between the original identifiers and the original strings corresponding to all the setting options in the BIOS system;
[0103] The file construction module 430 is used to construct a target JSON file matching the target setting page according to the target identifier and target string corresponding to each target option, and send the target JSON file to the baseboard management controller BMC to achieve communication with the BMC.
[0104] The technical solution provided by the embodiment of the present invention detects that the BIOS system meets the JSON file construction conditions, obtains the target identifier corresponding to each target option in the target setting page in real time, obtains the target string matching each target identifier in the preset data information space according to the target identifier corresponding to each target option, constructs the target JSON file matching the target setting page according to the target identifier and the target string corresponding to each target option, and sends the target JSON file to the BMC to realize the technical means of communicating with the BMC, provides a convenient way to edit option information in the BIOS system, and greatly increases the convenience of human-computer interaction.
[0105] Based on the above embodiment, the identification acquisition module 410 includes:
[0106] A string array creation unit, used for creating a string array for storing repeated strings;
[0107] The repeated string determination unit is used to determine at least one repeated string according to the mapping relationship between all original identifiers and original strings stored in the data information space, and write each repeated string into the string array.
[0108] The string acquisition module 420 includes:
[0109] A current identification acquisition unit, used to sequentially acquire one target identification from the target identifications corresponding to all target options as a current processing identification;
[0110] An identification array processing unit, used to determine whether a current processing identification exists in a pre-built identification array, and if not, write the current processing identification into the identification array;
[0111] An identification judgment unit, used to judge whether there is an original identification consistent with the current processing identification in the data information space;
[0112] If so, the original string corresponding to the original identifier is used as the target string matched by the current processing identifier; if not, return to execute the operation of obtaining one target identifier as the current processing identifier in the target identifiers corresponding to all target options in turn until the processing of all target identifiers is completed.
[0113] The file construction module 430 includes:
[0114] a string determination unit, used to determine whether the target string corresponding to each of the target options is a repeated string; if so, update the target string to obtain an updated target string;
[0115] A JSON file construction unit, used to construct a target JSON file matching the target setting page according to the target string corresponding to each of the target options;
[0116] A string comparison unit, used for comparing the target string corresponding to each of the target options with each repeated string in the string array, and judging whether the target string is a repeated string according to the comparison result;
[0117] The string combining unit is used to combine the target identifier with the target string to obtain an updated target string.
[0118] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in the embodiments of the present invention, please refer to the methods provided by all the above embodiments of the present invention.
[0119] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0120] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0121] 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, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0122] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a communication method based on a JSON file.
[0123] In some embodiments, the communication method based on the JSON file may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the communication method based on the JSON file described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the communication method based on the JSON file in any other appropriate manner (e.g., by means of firmware).
[0124] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0125] Computer programs 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, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0126] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0127] To provide interaction with a user, the systems and techniques described herein may 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 the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0128] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0129] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0130] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0131] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A communication method based on JSON file, characterized in that: Applied in a basic input / output system BIOS, the method comprises: After detecting that the BIOS system meets the JSON file building conditions, the target identifier corresponding to each target option in the target setting page is obtained in real time; According to the target identifiers corresponding to the target options, in the preset data information space, a target string matching each of the target identifiers is obtained; The data information space pre-stores the mapping relationship between the original identifiers and the original strings corresponding to all the setting options in the BIOS system; According to the target identifier and the target string corresponding to each of the target options, a target JSON file matching the target setting page is constructed, and the target JSON file is sent to a baseboard management controller BMC to achieve communication with the BMC; After detecting that the BIOS system meets the JSON file building conditions, it also includes: Create a string array to store repeated strings; Determine at least one repeated string according to the mapping relationship between all original identifiers and original strings stored in the data information space, and write each of the repeated strings into the string array; The step of constructing a target JSON file matching the target setting page according to the target identifier and the target string corresponding to each target option includes: Compare the target string corresponding to each of the target options with each repeated string in the string array, and determine whether the target string is a repeated string according to the comparison result; If yes, then the target string is updated to obtain an updated target string; According to the target strings corresponding to the target options, a target JSON file matching the target setting page is constructed.
2. The method according to claim 1, characterized in that: According to the target identifiers corresponding to the target options, in the preset data information space, a target string matching each of the target identifiers is obtained, including: Among the target identifiers corresponding to all target options, one target identifier is obtained in turn as the current processing identifier; Determine whether the current processing identifier exists in the pre-built identifier array, and if not, write the current processing identifier into the identifier array; Determine whether there is an original identifier consistent with the current processing identifier in the data information space; If yes, the original string corresponding to the original identifier is used as the target string matched by the current processing identifier; Returns the operation of obtaining one target identifier as the current processing identifier in the target identifiers corresponding to all target options in turn until the processing of all target identifiers is completed.
3. The method according to claim 2, characterized in that After determining whether there is an original identifier consistent with the current processing identifier in the data information space, the method further includes: If not, the process returns to executing the target identifiers corresponding to all target options, and sequentially obtains one target identifier as the current processing identifier until the processing of all target identifiers is completed.
4. The method according to claim 1, characterized in that: The target string is updated to obtain an updated target string, including: The target identifier is combined with the target string to obtain an updated target string.
5. A communication device based on JSON file, characterized in that: Applied to the basic input and output system BIOS, including: The identification acquisition module is used to obtain the target identification corresponding to each target option in the target setting page in real time after detecting that the BIOS system meets the JSON file construction conditions; A string acquisition module, used to acquire a target string matching each target identifier in a preset data information space according to the target identifier corresponding to each target option; The data information space pre-stores the mapping relationship between the original identifiers and the original strings corresponding to all the setting options in the BIOS system; A file construction module, used for constructing a target JSON file matching the target setting page according to the target identifier and the target string corresponding to each of the target options, and sending the target JSON file to a baseboard management controller BMC to achieve communication with the BMC; Wherein, the identification acquisition module includes: A string array creation unit, used for creating a string array for storing repeated strings; a repeated string determination unit, configured to determine at least one repeated string according to the mapping relationship between all original identifiers and original strings stored in the data information space, and write each of the repeated strings into the string array; The file construction module includes: A string comparison unit, used for comparing the target string corresponding to each of the target options with each repeated string in the string array, and judging whether the target string is a repeated string according to the comparison result; a string determination unit, used to determine whether the target string corresponding to each of the target options is a repeated string; if so, update the target string to obtain an updated target string; The JSON file construction unit is used to construct a target JSON file matching the target setting page according to the target string corresponding to each of the target options.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the JSON file-based communication method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the JSON file-based communication method according to any one of claims 1 to 4 when executed.
8. 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 to 4.
