Distributed board function update method, main control board, driver board and ergonomic chair
Through the distributed board structure and bus communication, the main control board parses the function code of the driver board to generate a proxy function, which solves the problem of high cost of updating the intelligent functions of the ergonomic chair and achieves automatic function updates and plug-and-play effects.
Patent Information
- Application Number
- CN202410748769.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-12
AI Technical Summary
When adding smart functions to existing ergonomic chairs, the firmware update cost of the main control circuit board is high and the development progress is slow, making it difficult for users to subsequently upgrade the functions.
It adopts a distributed board structure and connects the main control board and the driver board through bus communication. The main control board parses the function code of the driver board to generate a proxy function and merges it into the function library to realize automatic update and call of the driver board functions. .
There is no need to connect to the Internet to update the main control board firmware, which simplifies the development process and reduces development costs. Users can easily add functional boards to achieve plug-and-play.
Smart Images

Figure CN118331611B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a distributed board function update method, a main control board, a driver board and an ergonomic chair. Background Art
[0002] The hardware design of traditional ergonomic chairs fits the requirements of human sitting posture and provides good sitting support for people who sit for a long time. With people's increasing requirements for seat functions and the trend of intelligent ergonomic chairs, the design of adding intelligent control functions to ergonomic chairs has emerged.
[0003] At present, some ergonomic chairs provide functions such as weight detection, backrest pressure detection, and sedentary timer, and use data detected by various types of sensors to achieve intelligent control and intelligent reminders. Usually, a main control circuit board is installed under the seat cushion of the ergonomic chair, and the data is obtained by connecting to various sensors on the ergonomic chair through the main control circuit board. When designing ergonomic chairs with different functions, the functions implemented by the main control circuit board will change due to changes in sensors. It is often necessary to replace the entire main control circuit board, or to upgrade the firmware of the main control circuit board through the Internet, which limits the development cost and progress, and is not conducive to consumers' subsequent upgrade functions. Summary of the invention
[0004] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0005] The embodiments of the present application provide a distributed board function update method, a main control board, a driver board and an ergonomic chair, which can automatically expand the functions of the main control board without the need for Internet upgrade.
[0006] In a first aspect, an embodiment of the present application provides a distributed panel function update method, which is applied to a main control board in the distributed panel, wherein the main control board is connected to all the driver boards in the distributed panel via a bus communication, and the main control board and the driver boards are respectively arranged at different positions of an ergonomic chair; the function update method comprises:
[0007] When a new driver board is connected to the bus according to a preset period scan, or a trigger signal indicating that a new driver board is connected is received through the bus, a function code sent by the new driver board is received, wherein the function code is a code corresponding to a function pre-stored by the new driver board and can be controlled to be executed;
[0008] Parsing the callable function modules in the function code and generating a proxy function, and binding the proxy function to the function module;
[0009] Merging the proxy function into the function library of the main control board, wherein the function library is actively loaded when the main control board is running;
[0010] When it is determined that the target function of the target driver board needs to be called, the target proxy function corresponding to the target driver board is searched in the function library, and a call request for the target function is sent to the target driver board according to the target proxy function.
[0011] In some embodiments, the parsing of the callable function modules in the function code and generating a proxy function includes:
[0012] Identify at least one of a module directory, a predetermined module division character, a call interface name, and a document comment in the function code to obtain an identification result of a function module division method;
[0013] Divide the function code according to the division method corresponding to the recognition result to obtain a function module that can be called;
[0014] A proxy function name is configured for the callable functional module, and a proxy function corresponding to the proxy function name is generated, wherein the proxy function is used to point to the functional module corresponding to the proxy function name when being called.
[0015] In some embodiments, the method further comprises:
[0016] Merging the function code into the code base of the main control board;
[0017] After obtaining the callable function module, the method further includes:
[0018] Compare the function code corresponding to the function module with the function code in the code library;
[0019] If the same function code exists, the proxy function name of the same function code in the code library is used for configuration;
[0020] If the same function code does not exist, a proxy function name is configured for the callable function module.
[0021] In some embodiments, after generating the proxy function corresponding to the proxy function name, the method further includes:
[0022] Sending the division method corresponding to the recognition result and the corresponding relationship between the proxy function name and the functional module to the new driver board, so that the new driver board establishes the corresponding relationship between the proxy function name and the functional module in the functional code with reference to the division method of the recognition result;
[0023] The sending a call request of the target function to the target driver board according to the target proxy function comprises:
[0024] A request data packet including a proxy function name of the target proxy function is sent to the target driver board, so that the target driver board executes a corresponding functional module according to the proxy function name.
[0025] In some embodiments, the step of merging the proxy function into a function library of the main control board includes:
[0026] The proxy function is stored in the function library, and the proxy function name corresponding to the proxy function is added to the index directory of the function library;
[0027] The index directory in the memory of the main control board is updated to load the proxy function name into the memory.
[0028] In some embodiments, the method further comprises:
[0029] When it is found that an existing driver board on the bus is offline according to a preset period, a proxy function of the offline driver board is determined;
[0030] The proxy function of the offline driver board is searched in the function library for shielding.
[0031] In some embodiments, the method further comprises:
[0032] When the offline driver board comes back online, the proxy function corresponding to the driver board that comes back online is unblocked in the function library;
[0033] Alternatively, when the proxy function corresponding to the new driver board is the same as the blocked proxy function in the function library, the proxy function corresponding to the new driver board is unblocked.
[0034] In a second aspect, an embodiment of the present application provides a distributed panel function update method, which is applied to a driver board in the distributed panel, wherein the driver board is connected to a main control board in the distributed panel via a bus communication, and the main control board and the driver board are respectively arranged at different positions of an ergonomic chair; the function update method comprises:
[0035] When receiving a code upload request from the main control board, sending a function code to the main control board, or actively sending the function code to the main control board after accessing the bus, so that the main control board generates a proxy function according to the function code, wherein the function code is a code corresponding to a function pre-stored by the driver board and can be controlled to be executed;
[0036] When receiving a call request sent by the main control board based on the proxy function, a function corresponding to the proxy function is executed according to the call request.
[0037] In some embodiments, the method further comprises:
[0038] Receive the division method corresponding to the recognition result sent by the main control board and the correspondence between the proxy function name and the function module, wherein the division method corresponding to the recognition result is the function module division method obtained by the main control board identifying the function code, and the proxy function name is the name of the proxy function;
[0039] A corresponding relationship between the proxy function name and the functional module in the functional code is established with reference to the division method of the recognition result.
[0040] In some embodiments, the call request includes a proxy function name of the proxy function; and executing a function corresponding to the proxy function according to the call request includes:
[0041] Parsing the proxy function name in the call request;
[0042] Execute the function of the function module corresponding to the proxy function name.
[0043] In some embodiments, the function code is generated by the source code of the firmware of the driver board, the function code is a subset of the corresponding source code, and points to the function of the firmware according to the function module; the function of executing the function module corresponding to the proxy function name includes:
[0044] Determine the function module of the function code corresponding to the proxy function name;
[0045] The firmware is loaded to execute at least one function of the firmware pointed to by the functional module.
[0046] In the third aspect, an embodiment of the present application provides a main control board, comprising at least one processor and a memory for communicating with the at least one processor; the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the distributed board function update method described in the first aspect above.
[0047] In a fourth aspect, an embodiment of the present application provides a driver board, comprising at least one processor and a memory for communicating with the at least one processor; the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the distributed board function update method as described in the second aspect above.
[0048] In a fifth aspect, an embodiment of the present application provides an ergonomic chair, comprising the main control board described in the third aspect and at least one drive board described in the fourth aspect, wherein the main control board and the drive board are arranged at different positions of the ergonomic chair and are connected via CAN bus communication.
[0049] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the distributed board function update method as described above.
[0050] The distributed panel function update method, main control board, driver board and ergonomic chair provided by the embodiments of the present application have at least the following beneficial effects: the main control board of the ergonomic chair is connected to each driver board through a bus. When a driver board is added to the ergonomic chair, the main control board obtains the function code of the new driver board. The function code is provided by the driver board and reflects the function that the driver board can be controlled to execute. The main control board determines the function module corresponding to the function to be controlled by parsing the function code, and then generates a proxy function corresponding to the function module, and merges the proxy function into the function library of the main control board. When the main control board needs to call the function of one of the driver boards, the function library searches for the driver board. The corresponding proxy function is generated, and a call request item is generated based on the proxy function, which is sent by the driver board. After receiving the call request, the driver board executes the corresponding function according to the functional module corresponding to the proxy function. Through the above method, when a new driver board is added to the ergonomic chair, the function code of the new driver board can be used to update the function library of the main control board. The main control board can directly call the function of the new driver board through the function library. Therefore, there is no need to burn the firmware of the main control board separately, nor is there any need to update the firmware of the main control board through networking means such as OTA, which simplifies the development process, reduces development costs, and is also conducive to users to directly add functional boards in the subsequent use process to achieve plug-and-play.
[0051] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the examples of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0053] Figure 1 This is a bus connection diagram of a main control board and a driving board of an ergonomic chair provided by an embodiment of the present application;
[0054] Figure 2 It is a schematic diagram of the flow of interaction between the main control board and the driver board provided by an embodiment of the present application;
[0055] Figure 3 It is an overall flow chart of a method for updating functions on a main control board side provided by an embodiment of the present application;
[0056] Figure 4 This is a flowchart of generating a proxy function and a proxy function name provided by an embodiment of the present application;
[0057] Figure 5 This is a flowchart of generating or updating a proxy function based on a code library provided by an embodiment of the present application;
[0058] Figure 6 This is a flow chart of sending a division mode and a corresponding relationship to a driving board provided by an embodiment of the present application;
[0059] Figure 7 This is a flowchart of updating a function library based on an index directory provided by an embodiment of the present application;
[0060] Figure 8 This is a flow chart of shielding a proxy function corresponding to an offline driver board provided by an embodiment of the present application;
[0061] Fig. 9 It is a flowchart of a method for processing a shielded proxy function provided by an embodiment of the present application;
[0062] Fig.10 It is an overall flow chart of a function update method on the driver version side provided by an embodiment of the present application;
[0063] Fig.11 It is a flowchart of establishing a correspondence between a proxy function name and a functional module according to a division method and a correspondence sent by a main control board, provided by an embodiment of the present application;
[0064] Fig.12 This is a flowchart of executing functions according to proxy function names provided by an embodiment of the present application;
[0065] Fig.13 is a flowchart of loading firmware to execute functions provided by an embodiment of the present application;
[0066] Fig.14 This is a schematic diagram of the connection structure of a main control board provided by an embodiment of the present application;
[0067] Fig.15 It is a schematic diagram of the connection structure of a drive board provided in one embodiment of the present application. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In addition, the characteristics, operations or features described in the specification can be combined in any appropriate manner to form various implementation methods. At the same time, the steps or actions in the method description can also be replaced or adjusted in order in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the accompanying drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a necessary sequence, unless otherwise specified that a certain sequence must be followed.
[0069] In the description of this application, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0070] The serial numbers of the components in this document, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).
[0071] At present, ergonomic chairs are developing towards intelligent methods. Sensors or other functional modules can be set at different positions to realize different functions. Under the traditional design, for centralized control, ergonomic chairs set up a main control board to connect various sensors and other functional modules. The sensor is responsible for collecting data, and other functional modules such as massage modules are responsible for executing the instructions sent by the main control board. However, this design relies on the firmware of the main control board for control. If a new functional module needs to be updated, it is necessary to simultaneously replace the new main control board or update the firmware of the main control board. Obviously, the manufacturer of the ergonomic chair needs to redesign the main control board, which increases the development cost, or the firmware of the main control board needs to be updated online, such as by OTA push update, which also requires the manufacturer to reprogram and debug the new firmware, which also increases the development cost. Therefore, for both the function development process of the ergonomic chair and the user's function update, there is a problem of inconvenience in updating functions.
[0072] In order to facilitate the addition or deletion of functions, the ergonomic chair of the embodiment of the present application adopts a distributed panel, that is, it includes a main control board and multiple driver boards. The multiple driver boards drive sensors and functional modules separately, and the main control board connects to each driver board to issue instructions and receive data. In this way, the driver board and the sensors and functional modules corresponding to the driver board can be replaced separately without involving the replacement of the main control board. However, the firmware of the main control board still needs to be able to recognize the replaced driver board. Unless the replaced driver board is a driver board of the same type, the current firmware of the main control board cannot send and receive data to the replaced driver board. Based on this requirement, the embodiment of the present application is based on an ergonomic chair with distributed panels, which uses the pre-stored function code of the driver board to automatically update the firmware to achieve control of any new driver board.
[0073] The present application embodiment provides a distributed board function update method, a main control board, a driver board and an ergonomic chair, referring to Figure 1 As shown, the main control board of the ergonomic chair is connected to each driver board through a bus. When a driver board is added to the ergonomic chair, the main control board obtains the function code of the new driver board, which is provided by the driver board and reflects the function that the driver board can be controlled to execute. The main control board determines the function module corresponding to the function to be controlled by parsing the function code, and then generates a proxy function corresponding to the function module, and merges the proxy function into the function library of the main control board. When the main control board needs to call the function of one of the driver boards, the function library searches for the proxy function corresponding to the driver board, and generates a call request item based on the proxy function to be sent by the driver board. After receiving the call request, the driver board executes the corresponding function according to the function module corresponding to the proxy function. In the above manner, when a new driver board is added to the ergonomic chair, the function library of the main control board can be updated with the function code of the new driver board, and the main control board can directly call the function of the new driver board through the function library, so there is no need to burn the firmware of the main control board separately, nor is there any need to update the firmware of the main control board through networking means such as OTA, which simplifies the development process and reduces the development cost. It is also beneficial for users to directly add functional boards in the subsequent use process to achieve plug-and-play.
[0074] Reference Figure 1 and Figure 2 As shown, the embodiment of the present application provides a distributed panel function update method, which is applied to the main control board in the distributed panel, the main control board is connected to all the driver boards in the distributed panel through bus communication, and the main control board and the driver board are respectively arranged at different positions of the ergonomic chair; Figure 3 As shown, the distributed board function update method includes but is not limited to the following steps:
[0075] Step S110, when a new driver board is connected to the bus according to a preset period scan, or a trigger signal indicating that a new driver board is connected is received through the bus, a function code sent by the new driver board is received, and the function code is a code corresponding to a function pre-stored by the new driver board and can be controlled to be executed;
[0076] Ergonomic chairs achieve additional intelligent functions by setting up multiple driver boards. For example, a driver board for a massage module is added to the lumbar support, a driver board for a heating module is set at the headrest, and a driver board for electric lifting is set at the palm rest. These driver boards are connected to the main control board through a bus. The main control board uniformly controls each driver board to perform corresponding functions and receives data sent by each driver board. This distributed board arrangement method is conducive to ergonomic chair manufacturers to simply add or remove driver boards to add or delete functions when developing products. For example, when replacing the massage module at the lumbar support, the driver board of the massage module is replaced with a heating module. This new heating module is connected to the original bus and then connected to the main control board. In the case of replacing a new type of driver board, the original main control board firmware cannot directly recognize the new driver board. The main control board updates the firmware of the main control board by obtaining the function code of the driver board to achieve the firmware upgrade of the main control board.
[0077] The main control board can scan the driver board on the bus in a preset cycle, and can know the real-time access status of the driver board on the bus. If the CAN bus is used to connect the main control board and the driver board, the main control board can scan the driver board in the idle state of the CAN bus based on the CAN bus synchronization cycle, and send a data frame for reporting the online status to the bus in the form of broadcast. When the driver board receives this type of data frame, it sends a reply data frame to the bus. The main control board receives these reply data frames on the bus and parses the data frames to determine the number and increase or decrease of the driver board on the current CAN bus. This periodic scanning method is an active detection method, which is especially suitable for the situation where the driver board does not trigger a signal to the main control board when it accesses or exits the bus. The main control board can grasp the increase or decrease of the driver board in real time through scanning.
[0078] The main control board can also passively receive the data frame sent by the driver board after it is connected to the bus, that is, the trigger signal mentioned above. The data frame of the trigger signal informs the main control board through the bus that a new driver board is connected, and the data frame of the trigger signal carries some identity identification data of the new driver board. The main control board receives the data packet of the trigger signal from the bus and parses it, and can record the identity identification data of the new driver board.
[0079] Afterwards, the main control board can send a request to the new driver board to let the new driver board send a pre-stored function code, or the new driver board can actively send a pre-stored function code to the main control board after connecting to the bus, so that the main control board can obtain the function code of the new driver board. It is worth noting that the function code of the present application needs to be brought by the driver board. The function code can be generated and written into the memory of the driver board during the development stage of the driver board's firmware. The function code corresponds to the function that the driver board can perform. For example, if the new driver board is the driver board of the vibration module, the new driver board has a vibration gear setting function and a vibration component selection function, then the function code corresponds to the vibration gear setting function and the vibration component selection function. In order to be easily recognized by the main control board, the function code can be stored in the form of source code, but the function code alone cannot be compiled to form a complete program. For example, the part of the function code corresponding to the vibration gear setting function records the main functions in the form of source code, but lacks compilation parameters, making it impossible for other developers to directly compile the driver board firmware from the function code; for the main control board developed by the manufacturer itself, it can identify the part of the function code corresponding to the vibration gear setting function, extract the main functions used, and generate the corresponding proxy function. Of course, the function code can also be stored in a non-source code format, using a special method to encrypt the data, and the encrypted data is sent to the main control board as the function code. The main control board decrypts the required data based on the same encryption and decryption system.
[0080] In summary, for a driver board newly connected to the bus, the main control board obtains the function code of the driver board through the bus, and uses it to subsequently identify the function code to determine the function of the driver board, thereby realizing self-identification driving of the driver board.
[0081] Step S120, parsing the function modules that can be called in the function code and generating proxy functions, and binding the proxy functions to the function modules;
[0082] The main control board parses the received function code to identify the corresponding function module in the function code. As mentioned above, the function code of the driver board reflects the functions that the driver board can perform. For example, the driver board has two function modules: the vibration gear setting function and the vibration component selection function. The function code is divided into two parts of code: the vibration gear setting function and the vibration component selection function. The main control board determines the function module that can be called by the driver board by identifying these two parts of code. As for how the main control board parses the function module division in the function code, it can be divided by identifying the functions in the function code, the developer's annotation information in the function code, etc. This will be explained in detail later.
[0083] After parsing the function code, the main control board determines the function module corresponding to the new driver board, generates proxy functions for different function modules, and binds the function modules and proxy functions. The proxy function is directly called by the main control board during subsequent use. When calling, it calls the function module according to the binding relationship, so that it can issue instructions to instruct the new driver board to execute the function module corresponding to the proxy function. In this way, the main control board can call the proxy function without knowing the specific executable functions of the new driver board. It only needs to know which proxy functions correspond to the new driver board, and the new driver board can be controlled by calling the proxy function (the new driver board needs to establish a correspondence between the proxy function and the function module at the same time to identify which function module the proxy function corresponds to. This will be explained in the introduction of the driver board later).
[0084] Step S130, merging the proxy function into the function library of the main control board, wherein the function library is actively loaded when the main control board is running;
[0085] The main control board is provided with a function library, in which the proxy functions of each driver board are stored. When the main control board is running, the function library is actively loaded into the memory (actually, only the index directory of the function library can be loaded into the memory, and the index directory points to the proxy function of the function library). The main control board can quickly call each proxy function to achieve a fast response of the ergonomic chair control. For a newly connected driver board, if a new proxy function is added, the proxy function is merged into the function library and loaded into the memory. At this time, the main control board can call the function of the new driver board, so the plug-and-play of the new driver board can be achieved.
[0086] Step S140, when it is determined that the target function of the target driver board needs to be called, the target proxy function corresponding to the target driver board is searched in the function library, and a call request for the target function is sent to the target driver board according to the target proxy function.
[0087] According to the above steps S110 to S130, the proxy functions of each driver board are obtained, and the main control board records the corresponding proxy functions for each driver board connected to the bus through the function library. After completing the function library update, if the main control board needs to call the function of any driver board (target driver board), it will search the target proxy function corresponding to the target driver board in the function library, and then send instructions to the target driver board by calling the target proxy function, so that the target driver board will execute the function corresponding to the target proxy function.
[0088] In actual operation, the ergonomic chair can set a screen at the armrest to display the human-computer interaction interface. The human-computer interaction interface establishes a corresponding relationship with the proxy function through virtual buttons and the like. For example, the vibration gear setting function provides three optional vibration gears of high, medium and low. Three buttons are displayed on the human-computer interaction interface, corresponding to the three proxy functions of the single optional vibration gears of high, medium and low (or three different parameters of the same proxy function). The user or the manufacturer's developer selects a button by operating the human-computer interaction interface, and the main control board calls the proxy function of the corresponding gear according to the selected button, thereby sending a call request for the corresponding gear to the driver board. After receiving the call request, the driver board executes the corresponding optional vibration gear.
[0089] In summary, through the above steps S110 to S140, the newly connected driver board on the bus sends a function code to the main control board, so that the main control board can generate a proxy function corresponding to the function module based on the function code, so that when the main control board calls the new driver board, the proxy function is used to control the new driver board to perform the corresponding function. Since the main control board is oriented to the proxy function, it is not necessary to know the specific function of the proxy function. After the driver board obtains the correspondence between the proxy function and the function module, the main control board can perform the function control of the driver board based on the proxy function. Therefore, the ergonomic chair of the embodiment of the present application can arbitrarily add any type of driver board as long as the function code is pre-set. In other words, the function update method of the embodiment of the present application does not need to update the firmware of the main control board online. After the new driver board is connected, the update of the function library can be completed synchronously, and the function call of the cross-type driver board can be realized, which reduces the difficulty of function development of the ergonomic chair. It is also convenient to add and delete driver boards during user use, and it can be used normally without updating the firmware through OTA or other methods.
[0090] Reference Figure 4 As shown, in some embodiments, parsing the callable function modules in the function code and generating the proxy function in the above step S120 includes:
[0091] Step S210, identifying at least one of a module directory, a conventional module division character, a call interface name, and a document comment in the function code, and obtaining an identification result of the function module division method;
[0092] Step S220, dividing the function code according to the division method corresponding to the recognition result to obtain a function module that can be called;
[0093] Step S230, configuring a proxy function name for the callable function module, and generating a proxy function corresponding to the proxy function name, the proxy function being used to point to the function module corresponding to the proxy function name when being called.
[0094] The main control board needs to be able to identify the function code to implement the division of the function modules. Depending on the form of the function code, the main control board has different ways of identifying the function code. The following describes several situations.
[0095] For example, a module directory is pre-set in the function code, and the main control board searches the module directory in the function code to determine which function modules are included in the function code (or, which function modules are included in the driver board). The module directory is generated or written by the developer when developing the driver board (for example, after completing the firmware development of the driver board, a module directory corresponding to the function module is generated by a specific tool and added to the function code, or the module directory is written during the development of the driver board's firmware, and the module directory is exported to the function code after the firmware development is completed); in some possible cases, the function code of the driver board only has a module directory but not related source code and other data. The main control board can also generate proxy functions based only on the items in the module directory, as long as the driver board itself knows the correspondence between the items in the module directory and the function modules. This method can simplify the function code and reduce the difficulty of the main control board to identify the function code, but the driver board needs to set the correspondence between the items in the module directory and the function modules in advance.
[0096] For another example, an agreed module division character is set in the function code, and the main control board determines which line of the source code of the function module ends through the module division character; for example, the character vibrationlevel is set at the end of the source code of a gear function, and when the main control board recognizes the source code, the gear function module is determined according to the agreed vibration level character. It is understandable that the agreed module division character can be set in the function code, so that the main control board can know the agreed module division character after receiving the function code. It is worth noting that the above-mentioned setting of the module division character in the source code is actually convenient for developers to generate function codes. The module division character is written during the development process, and the function code is generated during the compilation process, which reduces the development difficulty for developers.
[0097] Another example is to determine the division of functional modules through the calling interface name in the functional code. Since different types of functional calls have different interfaces (or the combinations of multiple called interfaces have different combinations), different functional modules can be determined by identifying the differences in the calling interfaces.
[0098] For example, document comments are set in the function code. The role of document comments is similar to that of module division characters, but document comments do not belong to the part of the source code that is compiled into executable statements. However, document comments can be added to the function code, and the main control board recognizes the document comments to determine different function modules.
[0099] Of course, in some cases, the main control board can also be developed to be able to identify functions in the function code, and determine how the function modules are divided by the relationship between the functions. For example, a pre-trained neural network is set up on the main control board, and each function module in the function code can be identified after the function code is input based on the function implementation of the code. The training process of the neural network focuses on the functions that may be realized by the ergonomic chair, and the source code training set of the corresponding function is input, so that a neural network suitable for identifying the functions of the driver board of the ergonomic chair can be trained.
[0100] Each of the above examples of module directory, agreed module division characters, calling interface name and document comments is effective individually, and more than two division methods can be mixed to realize the division of functional modules. For example, combining the calling interface name and document comments, the main control board checks the calling interface name (or a combination of calling interfaces) to determine the functional module division while also checking the document comments. The module division obtained by calling the interface name and the module division obtained by document comments can be compared. For the same module division, a merged set is formed, and for different modules, they are added to the merged set. The above is only an example of a composite identification of functional module division, and the division judgment can also be carried out in other ways, which are not given here one by one.
[0101] After obtaining the identification result of the functional module division method through the above step S210, the functional code is divided according to the division method corresponding to the identification result to obtain the function module that can be called. The functional module here is used to generate the proxy function, so the functional module is formally related to the division method of the above step S210; for the case where the functional code only has a module directory, the functional module is actually just an item in the module directory. For the case where the functional code has source code, the functional module can be divided according to the above method to obtain multiple source code segments. These source code segments themselves cannot be compiled into programs, but the main control board can generate proxy functions based on them.
[0102] When generating a proxy function, the main control board configures the proxy function name according to the functional module, and generates a proxy function with the proxy function name at the same time. The proxy function is mainly an interface call code or a data call code, and the main control board writes / generates it in a relatively simple form, so that the main control board can directly run the corresponding function when calling the proxy function, or convert the proxy function into a script or program, etc., so that the main control board can directly run the script or load the program when calling the proxy function. In short, the role of the proxy function is to complete the call, which can be realized by a simple statement, and can point to the functional module corresponding to the proxy function name when it is called. The proxy function name can be generated according to the function or source code or directory item in the functional module, and it does not participate in the function execution itself. Therefore, the proxy function name is a string of characters. When calling, the main control board can call the proxy function through the proxy function name, and send a call request containing the proxy function name to the driver board, and then determine the functional module to be executed based on the proxy function name at one end of the driver board. In short, after identifying the division of the functional module, the main control board generates a proxy function and a proxy function name for each functional module to establish a corresponding relationship with the functional module.
[0103] Reference Figure 5 As shown, in some embodiments, the distributed board function update method of the present application also includes:
[0104] Step S310, merging the function code into the code library of the main control board;
[0105] After obtaining the callable function module in the above step S220, the distributed board function update method of the present application further includes:
[0106] Step S320, comparing the function code corresponding to the function module with the function code in the code library;
[0107] Step S330: If the same function code exists, the proxy function name of the same function code in the code library is used for configuration;
[0108] Step S340: If the same function code does not exist, a proxy function name is configured for the callable function module.
[0109] In addition to the function library, the main control board also has a code library, which is used to store the function code sent by the driver board. After receiving the function code, the main control board stores the function code in the code library to facilitate the subsequent comparison of the new function code with the function code in the code library. The function codes in the code library are also divided according to the function modules (if the function code only corresponds to one function module, no division is required), which can facilitate the subsequent search for the corresponding code in the code library according to the function module. After obtaining the callable function module, the main control board can determine how the function code is divided. At this time, the function code fragments correspond to the function modules one by one; the code in the code library is searched according to the code corresponding to the function module. If the same function code is found (if the function code is divided, then this is the function code segment), it indicates that the same function code has generated a proxy function and a proxy function name before, then the proxy function name corresponding to the function code can be directly used, but further configuration is required. During the configuration process, the existing proxy function name needs to be bound to the current new driver board to avoid calling the same proxy function name and calling the wrong driver board; if the same function code is not found (if the function code is divided, then this is the function code segment), it indicates that the same function code has not been added to the code library before, and it is a new function. Therefore, according to the above step S230, a new proxy function and a proxy function name are configured, and the new proxy function and the proxy function name are bound to the new driver board.
[0110] It can be understood that the code library is used to simply store function codes. When comparing the function codes in the code library with new function codes, it is performed by traversal. This can ensure the speed when the number of driver boards connected to the bus is small. In order to further speed up the comparison, the code library can extract representative values based on the currently stored function codes as the code library directory. This code library directory can be implemented in different forms; for example, for each function code in the code library (if the function code is divided, it is the function code segment here), the N characters at the head are taken as the items of the code library directory. When comparing the function code of the new driver board, the code library directory is also searched according to the N characters at the head of the function module. When it is found that the head has the same N characters, the characters after the head are further compared. This can speed up the search and shorten the time required to generate the proxy function. For another example, the main control board extracts the feature value of each function code in the code library (if the function code is divided, it is the function code segment here), for example, by extracting key characters to determine the feature value of the function code, and generates a code library directory based on the feature value. When comparing the function code of the new driver board, the key characters are extracted according to the same rules to obtain the feature value of the function code of the new driver board, and the code library directory is searched based on the feature value. If a matching feature value appears, the characters of the two function codes are further compared to see if they are exactly the same. This can also speed up the search and shorten the time required to generate the proxy function.
[0111] Reference Figure 6 As shown, in some embodiments, after generating the proxy function corresponding to the proxy function name in the above step S230, the distributed board function update method of the present application further includes:
[0112] Step S410, sending the division method corresponding to the identification result and the correspondence between the proxy function name and the functional module to the new driver board, so that the new driver board can establish the correspondence between the proxy function name and the functional module in the functional code with reference to the division method of the identification result;
[0113] In the above step S140, sending a call request for a target function to a target driver board according to the target proxy function includes:
[0114] Step S420, sending a request data packet including a proxy function name of a target proxy function to a target driver board, so that the target driver board executes a corresponding functional module according to the proxy function name.
[0115] After generating the proxy function, the main control board needs to inform the driver board of the correspondence between the proxy function and the functional module, and also inform the driver board of how the functional code is divided. The main control board returns the division method corresponding to the recognition result and the correspondence between the proxy function name and the functional module to the driver board. After receiving it, the driver board divides the functional code according to the division method of the recognition result, obtains the functional module and binds the functional module to the proxy function name. Similarly, since the functional code is in various forms, the division method and the corresponding relationship sent by the main control board will also be different, and the driver board will bind the proxy function name and the functional module in different ways according to the division method and the corresponding relationship received.
[0116] For example, in the case where the function code only has a module directory, the division method is the division of items in each module directory, and the corresponding relationship is the corresponding relationship between the module directory items and the proxy function names. The driver board can directly know the module directory items through the function code. At this time, the corresponding relationship between the module directory items and the proxy function names received can establish the corresponding relationship between the proxy function names and the function modules, and then can know the function to be executed after receiving the call request containing the proxy function name.
[0117] For example, in the case where the function code includes source code, the division method is to divide the function modules according to the agreed module division characters, calling interface names and document comments, and the corresponding relationship is the correspondence between the proxy function name and the function module. The driver board needs to wait for the main control board to send the division method and the corresponding relationship to the local, and then divide the local function code based on the division method to determine the function module, and then determine the correspondence between the function module and the proxy function name according to the corresponding relationship, so that the function to be executed can be known after receiving the call request containing the proxy function name.
[0118] After the driver board establishes the correspondence between the proxy function name and the functional module in the function code according to the above division method and the above correspondence, it is ready to receive the call request sent by the main control board. The call request is sent to the driver board in the form of a request data packet, and the proxy function name is included in the request data packet. After receiving the request data, the driver board determines the function to be executed based on the correspondence between the proxy function name and the functional module in the function code. For the main control board and driver board connected in the form of CAN bus, the request data packet is a data frame, the proxy function name is added to the data segment of the data frame, and the ID is set in the data frame so that only the target driver board can receive it (it is necessary to avoid other driver boards with the same proxy function name from receiving and processing the request data packet. The value of the ID can be set for the driver board alone or for the installation position of the driver board).
[0119] Reference Figure 7As shown, in some embodiments, in the above step S130, merging the proxy function into the function library of the main control board includes:
[0120] Step S510, storing the proxy function in a function library, and adding the proxy function name corresponding to the proxy function to the index directory of the function library;
[0121] Step S520: update the index directory in the memory of the main control board to load the proxy function name into the memory.
[0122] The function library is set to use an index method to speed up the retrieval speed. For the proxy function generated by the main control board, the proxy function is directly stored in the function library, but the function library is not directly loaded into the memory afterwards. Instead, the index directory of the function library is maintained. The index directory records each proxy function in the function library. When a new proxy function enters the function library, the index directory of the function library is updated and synchronized to the index directory in the memory, so that the main control board can directly retrieve the items in the index directory from the memory. In this embodiment, the proxy function name is used as the item in the index directory. The proxy function name is in the form of a string, so the size of the index directory will only occupy a very small capacity of memory, which is easy to achieve fast retrieval without affecting the processing performance of the main control board.
[0123] When generating the proxy function name, the string can be generated according to certain rules. Since the main control board usually does not need to know the function of the functional module corresponding to the proxy function, the proxy function name can be unrelated to the function of the functional module. For example, the proxy function name is set to Proxyf001P003, the prefix Proxyf represents the proxy function, 001 represents the first serial number of the driver board, P is the separator, and 003 is the third proxy function of the first serial number of the driver board. According to this rule, it is convenient for the main control board to call the corresponding proxy function for a specific driver board. Of course, it is also possible to generate the proxy function name in a more complex way, such as converting the hexadecimal string according to the characters of the source code in the functional module. This string is obviously unique, and the proxy function can be directly specified when calling, etc. Other rules for generating proxy function names are not introduced here one by one.
[0124] Reference Figure 8 As shown, in some embodiments, the distributed board function update method of the present application also includes:
[0125] Step S610, when it is detected according to a preset period that an existing driver board on the bus is offline, determining a proxy function of the offline driver board;
[0126] Step S620, searching the function library for the proxy function of the offline driver board for shielding.
[0127] As can be seen above, the main control board can scan the driver board in a preset cycle on the bus, and the real-time access status of the driver board on the bus can be known. For the situation where the driver board does not trigger a message to the main control board after going offline, the periodic scanning of the above step S610 is applicable. If the main control board and the driver board are connected by CAN bus, the main control board broadcasts a data frame for reporting the online status. When the data packet reported by the driver board is missing in this cycle, the access status of the driver board in the previous cycle is compared to determine which driver board is missing, and its proxy function can be shielded for the driver board. Since there may be a situation where the driver board on the bus returns a data packet loss, resulting in the main control board not receiving the data packet reporting the online status of the driver board in this cycle, in order to eliminate the situation of data packet loss, it is further judged in combination with the situation in the next several scanning cycles; if no data packet reporting the online status of the same driver board is received in the next several scanning cycles, it is determined that the driver board is in an offline state.
[0128] For the offline driver board, the corresponding proxy function is searched in the function library for shielding. If the function library maintains an index directory, the proxy function name of the shielded proxy function is deleted in the index directory, and then the index directory in the memory is updated, which can reduce the burden of the main control board to retrieve the function library or index directory. It can be understood that different means can be used to shield the proxy function, such as directly deleting the proxy function corresponding to the offline driver board in the function library. If the offline driver board is online again, it is regarded as a new driver board to regenerate the proxy function, or the proxy function corresponding to the offline driver board in the function library is not deleted, and only the identifier is set to exclude the proxy function from the retrieval range of the main control board. In this way, after the offline driver board is online again, the main control board compares the driver board identification (such as the hardware ID of the driver board) in the historical record, and can directly activate the corresponding proxy function without regenerating the proxy function. This is suitable for the situation where the connection line of the driver board on the bus may be loose, which will cause the driver board to go offline and online many times.
[0129] Reference Fig. 9 As shown, in some embodiments, the distributed board function update method of the present application also includes:
[0130] Step S710, when the offline driver board comes back online, unblock the proxy function corresponding to the driver board that comes back online in the function library;
[0131] Alternatively, in step S720, when the proxy function corresponding to the new driver board is the same as the blocked proxy function in the function library, the proxy function corresponding to the new driver board is unblocked.
[0132] For the above step S710, the scheme of unblocking the proxy function when the driver board in the offline state comes back online is that after the driver board goes offline, only the identifier is set to exclude the proxy function from the search range of the main control board, and the proxy function is reactivated when it comes back online, so that the main control board can retrieve the reactivated proxy function. This scheme needs to record the identifier of each driver board (such as the hardware ID of the driver board, etc.), which increases the storage overhead, but does not need to frequently generate proxy functions.
[0133] Of course, there are some special cases where some driver boards have proxy functions with similar or identical functions. For example, the driver board of the vibration module and the driver board of the massage module can both have proxy functions for the function of gear adjustment (assuming that the two are the same, although there are differences in the vibration mode in actual control that cause the two to be different), so the proxy functions can be shared. For the above step S720, if the identification of each driver board is not recorded, consider recording according to the type of proxy function. Specifically, if an offline driver board causes the main control board to shield the proxy function A, and at this time another driver board is online, the main control board determines that the driver board also needs to generate the proxy function A, then there is no need to add the proxy function A to the function library, but to unblock the proxy function A, simplifying the step of storing in the function library. Of course, there will be some problems that need to be solved, that is, two online driver boards share the same proxy function B. After one of the driver boards is offline, the shared proxy function B cannot be blocked. At this time, the shared status of the proxy function B is determined by the occupied mark. That is, when each driver board is connected, if the same proxy function B exists in the function library, an occupied mark is set for the proxy function B. The mark can be facing the driver board or anonymous. When the anonymous occupied mark is equal to 0, the proxy function B will be blocked. This solves the shielding problem caused by the above-mentioned shared status.
[0134] The steps of each of the above-mentioned embodiments are method steps on the main control board side. When a new driver board is connected to the bus, a proxy function is generated through the function code of the driver board to control the driver board, and a function library and an index directory of the function library are maintained, so that the function of the driver board can be quickly called. When the driver board is offline on the bus, the items in the index directory of the function library are shielded, and the index directory is dynamically adjusted to reduce the retrieval time when the main control board calls the driver board. Therefore, a plug-and-play solution for the driver board of an ergonomic chair is provided, which does not require manual updating of the firmware of the main control board, is convenient for manufacturers to test various new functions during development, and is also convenient for users to add and delete modules on the ergonomic chair.
[0135] Reference Figure 1 and Figure 2As shown, the embodiment of the present application also provides a distributed panel function update method, which is applied to a driver board in the distributed panel, the driver board is connected to the main control board in the distributed panel through bus communication, and the main control board and the driver board are respectively arranged at different positions of the ergonomic chair; Fig.10 As shown, the function update method includes but is not limited to the following steps:
[0136] Step S810, when receiving the upload code request from the main control board, sending the function code to the main control board, or actively sending the function code to the main control board after connecting to the bus, so that the main control board generates a proxy function according to the function code, and the function code is a code corresponding to the function pre-stored by the driver board and can be controlled to execute;
[0137] Step S820, when receiving a call request sent by the main control board based on the proxy function, executing the function corresponding to the proxy function according to the call request.
[0138] Similarly, ergonomic chairs achieve additional intelligent functions by setting up multiple driver boards. The driver boards establish communication connections with the main control board by connecting to the bus. The main control board uniformly controls each driver board to perform corresponding functions and receives data sent by each driver board. This distributed board arrangement method is conducive to ergonomic chair manufacturers to simply add or remove driver boards to add or delete functions when developing products.
[0139] During the development of the driver board's firmware, a function code is generated and written into the driver board's memory. The function code corresponds to the function that the driver board can perform. For example, if the new driver board is a driver board for a vibration module, the new driver board has a vibration gear setting function and a vibration component selection function, and the function code corresponds to the vibration gear setting function and the vibration component selection function. In order to be easily recognized by the main control board, the function code can be stored in the form of source code, but the function code alone cannot be compiled to form a complete program. For example, the part of the function code corresponding to the vibration gear setting function records the main functions used in the form of source code, but the lack of compilation parameters makes it impossible for other developers to directly compile the driver board's firmware from the function code; for the main control board developed by the manufacturer itself, the part of the function code corresponding to the vibration gear setting function can be identified, and the main functions used can be extracted to generate the corresponding proxy function. Of course, the function code can also be stored in a non-source code manner, and the data can be encrypted in a special way. The encrypted data is sent to the main control board as a function code, and the main control board decrypts the required data based on the same encryption and decryption system.
[0140] The driver board of the embodiment of the present application can also realize the function of actively reporting the function code and passively reporting the function code. Actively reporting the function code means that the driver board is connected to the bus, and the controller of the driver board determines that the connection is successful and can initiate a data packet according to the communication mode of the bus, which is used to send the function code in the memory to the main control board. Some identity identification data of the driver board can be carried in the data packet. The main control board receives the data packet of the trigger signal from the bus for parsing, and can record the identity identification data of the new driver board. In the case where the bus adopts the CAN bus, the driver board sends the data packet (data frame) when the bus is idle, or competes with other driver boards on the CAN bus for the right to send (the priority of the data frame of the function code reported by the new driver board can be lower to avoid affecting the normal data interaction of other driver boards that have been connected). Passively reporting the function code means that the driver board does not actively initiate a data packet when it is connected to the bus, and waits for the main control board to scan the driver board in a preset cycle to find that there is a new driver board connected. When the main control board scans that there is a new driver board connected, the main control board sends an upload code request to the driver board. After receiving the upload code request, the driver board sends the function code to the bus, which is then received by the main control board. When the bus adopts CAN bus, the driver board is equivalent to sending the function code in broadcast mode, and the data frame should be set to be recognized and received only by the main control board (for example, the data packet of the ID used by other driver boards to filter the data frame of the function code).
[0141] After the driver board uploads the function code to the main control board, it waits for the main control board to parse the received function code to identify the corresponding function module in the function code. After parsing the function code, the main control board determines the function module corresponding to the new driver board, generates proxy functions for different function modules, binds the function module and the proxy function, and updates the function library. The proxy function is directly called by the main control board in the subsequent use process, and when calling, it calls the function module according to the binding relationship, so that an instruction can be issued to instruct the driver board to execute the function module corresponding to the proxy function. In this way, the main control board can call the proxy function, without knowing the specific executable functions of the driver board, but only knowing which proxy functions the driver board corresponds to, and the new driver board can be controlled by calling the proxy function in the function library. As can be seen from the above, after the main control board completes the function library update, if the main control board needs to call the function of any driver board, it will search the target proxy function corresponding to the target driver board in the function library, and then send instructions to the target driver board by calling the target proxy function, so that the target driver board can execute the function corresponding to the target proxy function. Therefore, after receiving the call request of the main control board, the driver board can execute the corresponding function according to the call request.
[0142] Reference Fig.11 As shown, in some embodiments, the distributed board function update method further includes:
[0143] Step S910, receiving the division method corresponding to the recognition result sent by the main control board and the correspondence between the proxy function name and the function module, the division method corresponding to the recognition result is the function module division method obtained by the main control board identifying the function code, and the proxy function name is the name of the proxy function;
[0144] Step S920, establishing a correspondence between the proxy function name and the function module in the function code with reference to the division method of the recognition result.
[0145] In order to let the driver board know which function the call request corresponds to, the main control board needs to inform the driver board of its division method and corresponding relationship after dividing the function modules according to the function code. The main control board can identify the function code through at least one of the module directory, the agreed module division characters, the call interface name and the document comment, and obtain the recognition result of the function module division method, and then configure the proxy function name and generate the proxy function for the function module that can be called. The main control board then sends the identified division method and corresponding relationship to the driver board. After receiving it, the driver board establishes the corresponding relationship between the proxy function name and the function module according to the division method.
[0146] Since the function codes are in various forms, the division method and the corresponding relationship sent by the main control board will also be different, and the driver board will bind the proxy function name and the function module in a different way according to the division method and the corresponding relationship received.
[0147] For example, in the case where the function code only has a module directory, the division method is the division of items in each module directory, and the corresponding relationship is the corresponding relationship between the module directory items and the proxy function names. The driver board can directly know the module directory items through the function code. At this time, the corresponding relationship between the module directory items and the proxy function names received can establish the corresponding relationship between the proxy function names and the function modules, and then can know the function to be executed after receiving the call request containing the proxy function name.
[0148] For example, in the case where the function code includes source code, the division method is to divide the function modules according to the agreed module division characters, calling interface names and document comments, and the corresponding relationship is the correspondence between the proxy function name and the function module. The driver board needs to wait for the main control board to send the division method and the corresponding relationship to the local, and then divide the local function code based on the division method to determine the function module, and then determine the correspondence between the function module and the proxy function name according to the corresponding relationship, so that the function to be executed can be known after receiving the call request containing the proxy function name.
[0149] After the driver board establishes the correspondence between the proxy function name and the functional module in the function code according to the above division method and the above correspondence, it is ready to receive the call request sent by the main control board. The call request is sent to the driver board in the form of a request data packet, and the proxy function name is included in the request data packet. After receiving the request data, the driver board determines the function to be executed based on the correspondence between the proxy function name and the functional module in the function code. For the main control board and driver board connected in the form of CAN bus, the request data packet is a data frame, the proxy function name is added to the data segment of the data frame, and the ID is set in the data frame so that only the target driver board can receive it (it is necessary to avoid other driver boards with the same proxy function name from receiving and processing the request data packet. The value of the ID can be set for the driver board alone or for the installation position of the driver board).
[0150] Reference Fig.12 As shown, in some embodiments, the call request includes the proxy function name of the proxy function; the above step S820 executes the function corresponding to the proxy function according to the call request, including:
[0151] Step S1010, parsing the proxy function name in the call request;
[0152] Step S1020, executing the function of the function module corresponding to the proxy function name.
[0153] After receiving the data packet of the call request, the driver board parses the data packet to obtain the proxy function name in the data packet. Since the driver board already knows the correspondence between the proxy function name and the functional module through the above step S920, it can execute the function of the corresponding functional module according to the proxy function name in the data packet.
[0154] On the one hand, the proxy function name is used by the main control board to distinguish the proxy function of the driver board, and on the other hand, it is also used by the driver board to identify which function should be executed. Therefore, the naming rules for the main control board and the driver board to identify the proxy function name are similar to a certain extent, but there are also some differences. Take the proxy function name Proxyf001P003 as an example. According to the identification rules of the main control board, it can be known that the prefix Proxyf represents the proxy function, 001 represents the driver board with the first serial number, P is a separator, and 003 is the third proxy function of the driver board with the first serial number. According to the identification rules of the driver board, it can be known that the prefix Proxyf represents the proxy function, 001 does not work, P is a separator, and 003 is the third proxy function name obtained locally according to the above division method and corresponding method. Of course, it is also possible to generate the proxy function name in a more complex way, which will not be given one by one here.
[0155] Reference Fig.13As shown, in some embodiments, the function code is generated by the source code of the firmware of the driver board, the function code is a subset of the corresponding source code, and points to the function of the firmware according to the function module; the function of the function module corresponding to the proxy function name executed in the above step S1020 includes:
[0156] Step S1110, determining the function module of the function code corresponding to the proxy function name;
[0157] Step S1120, loading the firmware to execute at least one function of the firmware pointed to by the functional module.
[0158] The function code in this embodiment is in the form of source code, which is part of the firmware of the driver board. However, the function code alone cannot be compiled to form a complete program. For example, the part of the function code corresponding to the vibration gear setting function records the main functions used in the form of source code, but lacks compilation parameters, so that other developers cannot directly compile the driver board firmware from the function code; for the main control board developed by the manufacturer itself, it can identify the part of the function code corresponding to the vibration gear setting function, extract the main functions used, and generate the corresponding proxy function. In this case, the main control board divides the source code of the function code into multiple function modules, and then informs the driver board of the division method, so that the driver board can establish a corresponding relationship between the function module and the proxy function name. After the driver board receives the call request, based on the function module corresponding to the proxy function name, the firmware can be loaded to execute the corresponding function.
[0159] It can be understood that although the functional modules mentioned above all seem to implement a single function by default, in the actual division process, the same functional series or the same functional combination can be divided into a functional module. For example, the functional code of the driver board of the massage module can be divided into three operating mode functional modules, namely, the heating and massage functional module, the pure heating functional module and the pure massage functional module. When calling the heating and massage functional module, although the call is implemented through a proxy function name, the firmware of the driver board actually executes two functions, namely heating + massage.
[0160] The steps of each of the above embodiments are method steps on the driver board side, which mainly realize the reporting of function codes and the reception of call requests issued by the main control board to execute corresponding functions. Although the development of the driver board adds a step of generating function codes, the function codes can be generated based on the source code of the firmware, and the development workload will not increase too much. However, based on the function codes, the plug-and-play of the ergonomic chair driver board can be realized, and there is no need to update the main control board online, which facilitates the connection of driver boards with different functions to test new functions during the development process, and also facilitates users to add or replace driver boards by themselves.
[0161] An embodiment of the present application also provides a main control board, including at least one processor and a memory for communicating with the at least one processor; the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the distributed board function update method on the aforementioned main control board side.
[0162] Reference Fig.14 As shown, the control processor 1001 and the memory 1002 in the controller 1000 can be connected via a bus as an example. The memory 1002, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk memory, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1002 may optionally include a memory remotely arranged relative to the control processor 1001, and these remote memories may be connected to the controller 1000 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0163] Those skilled in the art will understand that Fig.14 The device structure shown in the figure does not constitute a limitation on the controller 1000, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0164] An embodiment of the present application also provides a driver board, comprising at least one processor and a memory for communicating with the at least one processor; the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the distributed board function update method on the aforementioned driver board side.
[0165] Reference Fig.15 As shown, the control processor 2001 and the memory 2002 in the controller 2000 can be connected by a bus as an example. The memory 2002, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory 2002 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk memory, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 2002 may optionally include a memory remotely arranged relative to the control processor 2001, and these remote memories may be connected to the controller 2000 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0166] Those skilled in the art will understand that Fig.15 The device structure shown in the figure does not constitute a limitation on the controller 2000, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0167] The embodiment of the present application also provides an ergonomic chair, including the aforementioned main control board and at least one drive board, the main control board and the drive board are arranged at different positions of the ergonomic chair and are connected via CAN bus communication. The drive board is arranged at different positions of the ergonomic chair to provide different functions, for example, the drive board for headrest heating is arranged at the headrest position, the drive board for electric adjustment of lumbar support is arranged near the lumbar support, etc. These drive boards are connected to the main control board via cables, and the main control board can be arranged inside the seat cushion chassis.
[0168] The embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by one or more control processors, for example, Fig.14 A control processor 1001 executes, or is Fig.15 One of the control processors 2001 executes, which can enable the above-mentioned one or more control processors to execute the distributed board function updating method in the above-mentioned method embodiment.
[0169] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0170] It will be appreciated by those skilled in the art that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0171] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present application. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A distributed board function update method, characterized in that: A main control board applied to the distributed panel, the main control board is connected to all the drive boards in the distributed panel through bus communication, and the main control board and the drive board are respectively arranged at different positions of the ergonomic chair; The function updating method comprises: When a new driver board is connected to the bus according to a preset period scan, or a trigger signal indicating that a new driver board is connected is received through the bus, a function code sent by the new driver board is received, wherein the function code is a code corresponding to a function pre-stored by the new driver board and can be controlled to be executed; Parsing the callable function modules in the function code and generating a proxy function, and binding the proxy function to the function module; Merging the proxy function into the function library of the main control board, wherein the function library is actively loaded when the main control board is running; When it is determined that the target function of the target driver board needs to be called, searching the function library for the target proxy function corresponding to the target driver board, and sending a call request for the target function to the target driver board according to the target proxy function; The step of parsing the function modules that can be called in the function code and generating a proxy function includes: Identify at least one of a module directory, a predetermined module division character, a call interface name, and a document comment in the function code to obtain an identification result of a function module division method; Divide the function code according to the division method corresponding to the recognition result to obtain a function module that can be called; Configuring a proxy function name for the callable function module, and generating a proxy function corresponding to the proxy function name, wherein the proxy function is used to point to the function module corresponding to the proxy function name when being called; After generating the proxy function corresponding to the proxy function name, the method further includes: Sending the division method corresponding to the recognition result and the corresponding relationship between the proxy function name and the functional module to the new driver board, so that the new driver board establishes the corresponding relationship between the proxy function name and the functional module in the functional code with reference to the division method of the recognition result; The step of sending a call request for the target function to the target driver board according to the target proxy function comprises: A request data packet including a proxy function name of the target proxy function is sent to the target driver board, so that the target driver board executes a corresponding functional module according to the proxy function name.
2. The method according to claim 1, characterized in that The method further comprises: Merging the function code into the code base of the main control board; After obtaining the callable function module, the method further includes: Compare the function code corresponding to the function module with the function code in the code library; If the same function code exists, the proxy function name of the same function code in the code library is used for configuration; If the same function code does not exist, a proxy function name is configured for the callable function module.
3. The method according to claim 1, characterized in that The step of merging the proxy function into the function library of the main control board comprises: The proxy function is stored in the function library, and the proxy function name corresponding to the proxy function is added to the index directory of the function library; The index directory in the memory of the main control board is updated to load the proxy function name into the memory.
4. The method according to claim 1, characterized in that The method further comprises: When it is found that an existing driver board on the bus is offline according to a preset period, a proxy function of the offline driver board is determined; The proxy function of the offline driver board is searched in the function library for shielding.
5. The method according to claim 4, characterized in that The method further comprises: When the offline driver board comes back online, the proxy function corresponding to the driver board that comes back online is unblocked in the function library; Alternatively, when the proxy function corresponding to the new driver board is the same as the blocked proxy function in the function library, the proxy function corresponding to the new driver board is unblocked.
6. A distributed board function update method, characterized in that: A driving board applied to the distributed panel, the driving board is connected to the main control board in the distributed panel through bus communication, and the main control board and the driving board are respectively arranged at different positions of the ergonomic chair; The function updating method comprises: When receiving a code upload request from the main control board, sending a function code to the main control board, or actively sending the function code to the main control board after accessing the bus, so that the main control board generates a proxy function according to the function code, wherein the function code is a code corresponding to a function pre-stored by the driver board and can be controlled to be executed; When receiving a call request sent by the main control board based on the proxy function, executing a function corresponding to the proxy function according to the call request; The method further comprises: Receive the division method corresponding to the recognition result sent by the main control board and the correspondence between the proxy function name and the function module, wherein the division method corresponding to the recognition result is the function module division method obtained by the main control board identifying the function code, and the proxy function name is the name of the proxy function; Establishing a correspondence between the proxy function name and the function module in the function code with reference to the division method of the recognition result; The calling request includes the proxy function name of the proxy function; and executing the function corresponding to the proxy function according to the calling request includes: Parsing the proxy function name in the call request; Execute the function of the function module corresponding to the proxy function name; The function code is generated from the source code of the firmware of the driver board, the function code is a subset of the corresponding source code, and points to the function of the firmware according to the function module; the function of the function module corresponding to the execution of the proxy function name includes: Determine the function module of the function code corresponding to the proxy function name; The firmware is loaded to execute at least one function of the firmware pointed to by the functional module.
7. A main control board, characterized in that: It includes at least one processor and a memory for communicating with the at least one processor; the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the distributed board function update method as described in any one of claims 1 to 5.
8. A driving plate, characterized in that: comprising at least one processor and a memory for communicatively connecting to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the distributed board function updating method as claimed in claim 6.
9. An ergonomic chair, characterized in that: It comprises the main control board as claimed in claim 7 and at least one driving board as claimed in claim 8, wherein the main control board and the driving board are arranged at different positions of the ergonomic chair and are connected via CAN bus communication.
Citation Information
Patent Citations
Microwave apparatus circuit board intelligentizing plug-in method
CN103246538A
Firmware upgrading system, method and device, electronic equipment and storage medium
CN117055923A
Distributed system online upgrading method based on RS485 bus
CN117055931A
Method and apparatus for updating software on remotely operated vehicle
GB201610416D0
